It's missing a closing brace. I would, however, tend to drop that way of
doing things and use a regex:

function ValidChard($file_name)
{
    if(preg_match("![^a-z0-9\-\.]!is", $file_name))
    {
        return false;
    }
    return true;
}

Much easier on the eye, don't you think? :)

James


"Magnus Nilsson" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
function valid_chars($file_name)
{

   for($i = 0; $i < strlen($file_name); $i++)
   {
if (!in_array($file_name[$i],
array('q','w','e','r','t','y','u','i','o','p','l','k','j','h',
'g','f','d','s','a','z','x','c','v','b','n','m','Q','W',
'E','R','T','Y','U','I','O','P','L','K','J','H','G','F',
'D','S','A','Z','X','C','V','B','N','M','0','1','2','3',
'4','5','6','7','8','9', '.', '_')))
  {
return false;
}
else
{
return true;
}
}

Found this snippet of code on php.net
(http://www.php.net/manual/sk/ref.strings.php), but it just reurns a
parse error.


OS: OS X 10.2
PHP: PHP 4.2.3
MYSQL: 3.23.51

// magnus n.





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

Reply via email to