Hey All,
Phone number format in our mysql db is (big surprise) constantly inconsistent.
We get anything from xxxxxxxxxx, (xxx) xxx-xxxx, (xxx)-xxx-xxxx, xxx.xxx.xxxx,
xxx.xxx.xxx .... you get the idea.
While I have found numerous examples of code to format phone numbers, nothing
I have encountered quite addresses the seemingly limitless possibilities.
It seems the thing to do would be to strip all non-numeric characters from all
phone#'s before formating as (xxx)xxx-xxxx, but I'm not sure where to start with that.
$query= mysql_query("SELECT phone_mobile FROM contacts WHERE phone_mobile !='$phone_mobile_formated'");
foreach($phone_mobile){
$query= mysql_query("UPDATE phone_mobile = '$formated_phone_mobile'");
}
Any input would be greatly appreciated!