Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

halben on "Preg_match not returning error?"

$
0
0

I was wondering if I could use preg_match in wordpress. I'm trying to validate a phone number and here is what I have:

if (preg_match("/^[0-9]{3}-[0-9]{3}-[0-9]{4}$/", $sanitized_phone))
			$errors[] = 'Error: Please enter a valid phone number. (e.g. 999-999-9999)';

I tested it and there's not error output. Anyone know why?


Viewing all articles
Browse latest Browse all 8245

Trending Articles