Geez... i've searched for 8 hours and tried numberous codes to format a simple 10 digit only US phone number. I wonder why no code ever works for such a simple task. Either the code is not documented such as a simple... where to place your phone number variable or how to set the format of the result. Anyways i always get an error or the code does not work. This code here just returns an empty field.
All i did here was add the code and place this line before it:
$Phone=$strPhone;
to move my phone number field to the codes variable. When I echo $strPhone I get nothing
As it is not documented - I assume the function is designed for US phone number formatting. Non US-citizens hardly know, whether this can be applied to any US phone number or whether this is restricted in some way (e.g. by region, kind etc.) or the other.
One can only tell from the code, that this function is valid for 10 digit phone numbers consisting of 3 digit area code and that the rest of the number is separated into a 3 digit prefix and rest...
Nevertheless, this snippet allows for easy adaptation to ones needs.
--
Chris Gmyr
www.chrisgmyr.com
www.syracusecs.com
www.syracusebands.net
All i did here was add the code and place this line before it:
$Phone=$strPhone;
to move my phone number field to the codes variable. When I echo $strPhone I get nothing
One can only tell from the code, that this function is valid for 10 digit phone numbers consisting of 3 digit area code and that the rest of the number is separated into a 3 digit prefix and rest...
Nevertheless, this snippet allows for easy adaptation to ones needs.