I'm trying to use preg_match() to only allow chars from a-z. I'm using this string:
if (! preg_match('/[^a-z]/i', $name)) {
echo 'Invalid characters in your name..';
return false;
}
But for some reason it's allowing all characters. I've starred at those lines for long time now, and I don't get why it doesn't work.