Forum Moderators: coopster
βαρίδι -> bob
function validateNames($name)
{
if (preg_match('!^([a-zA-Z]{3,25})$!', $name))
return true;
return false;
}//returns false
print validateNames(βαρίδι);
//returns true
print validateNames(bob);
Everything else works as expected if I don't do the check it will insert into the db and pull as correct encoding without issue.
I also tried setting ctype_alpa and setting a locale but that didn't work either.
utf8 is set as the charset
Can someone help point me in the right direction to resolve this
Best Regards,
Brandon
[edited by: eelixduppy at 7:44 pm (utc) on Jan. 17, 2009]
[edit reason] disabled smileys [/edit]
When dealing with entities you should be decoding them before the pattern:
validateNames(html_entitiy_decode("βαρίδι"));
Although given your pattern this is still going to return false.