ctype_digit but allow spaces
Posted: Mon Apr 10, 2006 1:09 pm
I want to validate some data - it has to be a phone number so only numbers, but I'd also like to allow spaces. can I use ctype_digit in combination with something?
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
$number = str_replace(" ", "", $tel);
//then
ctype_digit($number):