HelpMeSteve.com is a local handyman service that provides everything from pool cleaning to furniture assembly and spyware cleanup. I took this site from the monster that is Microsoft Publisher to a sleek, quick loading, css valid, php based website.
*Update* - Good SEO now gets this baby into number 1 in a result set of 47,000.
Here’s a quick php function that digests a ten digit string and spits out a 10-digit (phone number formatted) return variable.
xxxxxxxxxx => (xxx) xxx-xxxx
function format_phone($phone) {
$phone = preg_replace("/[^0-9]/", "", $phone);
if(strlen($phone) == 7)
return preg_replace("/([0-9]{3})([0-9]{4})/", "$1-$2", $phone);
elseif(strlen($phone) == 10)
return preg_replace("/([0-9]{3})([0-9]{3})([0-9]{4})/", "($1) $2-$3", $phone);
else
return $phone;
}