validate the number in numeric format
Wednesday, December 19th, 2007 <?php
function PhoneCheck($number)
{
return preg_match(”/^[(\[]?\d{3}[)-\.\] ]*\d{3}[-\. ]?\d{4}$/”, $number, $scrap);
}
?>
is one way…personally i save only the numbers and throw the rest away..makes it simpler and you can always change the display code to format a number for a particular use.
$phone = preg_replace(”[^0-9]”,”",$_POST[’phone’]);
Posted by Suresh B