working on a script that will take input from several fields provided by a user and drop them into a variable, one for each. I want to be able to make sure there are no numbers in the name fields or alphas in the number fields, someone suggested the preg_match function, so this is how I implemented it but it didn't work, is it just my implementation or is there a better function or set of functions?
if (preg_match("/^[a-zA-Z]*$/", $fname))
assuming all the characters in the variable $fname are upper or lower case alpha's it should return a true/1 correct? but it's not working for some reason, is this the correct function? any thoughts on it?
Question: Allowing and disallowing characters from input
Moderator: General Moderators