note 42144 deleted from function.preg-match by felipe

From: Date: Mon, 10 Dec 2007 01:38:39 +0000
Subject: note 42144 deleted from function.preg-match by felipe
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-133070@lists.php.net to get a copy of this message
Note Submitter: ---- A very simple Phone number validation function. Returns the Phone number if the number is in the xxx-xxx-xxxx format. x being 0-9. Returns false if missing digits or improper characters are included. <? function VALIDATE_USPHONE($phonenumber) { if ( (preg_match("/^[0-9]{3,3}[-]{1,1}[0-9]{3,3}[-]{1,1} [0-9]{4,4}$/", $phonenumber) ) == TRUE ) { return $phonenumber; } else { return false; } } ?>

« previous php.notes (#133070) next »