I am struggeling at implementing a check on a textbox.
I want to check if the phone number has a length of 10 characters, contains my country base number and if it is actually a numerical value.
i only know how to check if it is a number.
if(ctype_digit($telefon) && ctype_digit($telefon)=="10"){
...
} else {
echo "Invalid phone number";
}
Using PHP's 'strlen($string)' function would count every character including any format notations
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.