I'm trying to make sure a string I'm posting only has alphabetical and numberical letters/numbers + ,.; etc. However all checks I seem to do still bring back à è ò as valid?
Anyone know a solution for this?
Thanks
I'm trying to make sure a string I'm posting only has alphabetical and numberical letters/numbers + ,.; etc. However all checks I seem to do still bring back à è ò as valid?
Anyone know a solution for this?
Thanks
If you know exactly what characters you want to allow, a regex should be fitting your needs:
// matches exactly the characters you asked for, no more
preg_match(/[a-zA-Z0-9,\.;]*/, $your_string);
Be sure to escape meta characters, because for example a non-escaped dot (.) will match every character.