If $thumbname does not contain any regular expression syntax characters, it mean $item must begin with $thumbname to match the expression. Even a dot is a syntax character, the code should better be:

if (!preg_match("/^".preg_quote($thumbname)."/",$item))

preg_quote will escape special characters. But John's suggestion is better.

pete M wrote:

could someone explain what this bit of code does please...

if (!preg_match("/^".$thumbname."/",$item))
{
}

tia
PEte


-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to