Here is a snippet of my code. It works fine, but checks for upper and lower case letters.
if (empty($_POST["lastname"])) {
$lastnameErr = "Lastname is required";
} else {
$lastname = test_input($_POST["lastname"]);
if (!preg_match("/^[a-zA-Z ]*$/",$lastname)) {
$lastnameErr = "Only letters and white space allowed";
}
}
I need this to check for numbers only IE: 0-9 for a phone number format.
Thank you