Forum Moderators: coopster
I'm doing some form validation on a phone number field and it's returning invalid when I have a parenthesis as the first character of my phone number. Here's the code I have:
$bus_phone = $_POST["bus_phone"];
if(strlen($bus_phone < 10))
{
$error_msg .= "<li>Your phone number is invalid</li>";
$errors['bus_phone'] = 1;
}
This returns invalid: (234)234-4324
Does strlen not work with parenthesis or something? Thanks.