Hi,
I'm trying to detecte whether or not a string contains som special chars, but it won't work... pleasy help.
Code:
function specialtegnsCheck($text)
{
$errChars="½§!@#£¤$%&/{([)]";
for ($i=0; $i<strlen($errChars); $i++)
{
if (strpos($text, substr($errChars, $i, 1))===0)
return 0;
}
return 1;
}
$ok = specialtegnsCheck("X%X", $ok);
if ($ok==0)
print "ErrChar found!";
Why doesn't this print ErrChar found??
I've tried with == instead of ===, but that doesn't work either...
Sincerely,
Kenneth