What i am trying to do, and am probably going about it all wrong is to take a phone number break it down to just digits and make sure it is between 10 and 11 characters long, I guess somewhere i should have it check for integers also.
function hphone_fix($hphone)
{
for($hphonefix = strtok($hphone, " -()"); $hphonefix !== false; $hphonefix = strtok( " -()"))
{
echo $hphonefix;
}
}
if (strlen(hphone_fix($hphone) ==10))
{echo hphone_fix($hphone);}
else
{$hphoneerror = "Your phone number must be 10 or 11 digits";}
Does this look like im going in the right direction?