I am calling a phone number variable that is stored in my database and it is formatted with a "." separating the numbers. ie: 555.555.5555
When I echo this variable on a web site one of the macs I am using doesn't allow you to click on the number while the xp machine does. I am thinking I just need to reformat the string to make it something the mac can understand. I tried using str_replace to replace the "." with "-" but I get the same problem.
$ActivevPhone is the variable for the phone number I am echoing.
How would I go about doing this?
Thanks in advance!
4 Replies - 1753 Views - Last Post: 10 October 2009 - 04:33 PM
#1
Need to reformat a phone number so skype will recognize it on a mac
Posted 10 August 2009 - 09:20 AM
Replies To: Need to reformat a phone number so skype will recognize it on a mac
#2
Re: Need to reformat a phone number so skype will recognize it on a mac
Posted 10 August 2009 - 09:31 AM
Interesting that str_replace doesn't work, you could do substr and get all the different elements.
You could also use explode using periods, but I think the above method is cleaner. I am sure there is a preg_replace, but I am not too skilled at regex to help you with that.
--
Greg
$phoneNum = "907.569.0505" $areacode = substr($phoneNum, 0,3); $exch = substr($phoneNum,4,3); $num = substr($phoneNum,8,4); $phoneNum = $areacode . "-" . $exch . "-" . $num;
You could also use explode using periods, but I think the above method is cleaner. I am sure there is a preg_replace, but I am not too skilled at regex to help you with that.
--
Greg
#3
Re: Need to reformat a phone number so skype will recognize it on a mac
Posted 10 August 2009 - 11:19 AM
Had to tweak it a little bit but what you gave me worked! Apparently the mac has to have the number formatted like (555) 555-5555 in order for skype to recognize it on a website, in order to be clickable. Just made that simple modification and it worked perfectly! Thanks a lot!
#4
Re: Need to reformat a phone number so skype will recognize it on a mac
Posted 10 August 2009 - 11:26 AM
No probs.
#5
Re: Need to reformat a phone number so skype will recognize it on a mac
Posted 10 October 2009 - 04:33 PM
str_replace(".", "-", $ActivevPhone)
kyle4404, on 10 Aug, 2009 - 08:20 AM, said:
I am calling a phone number variable that is stored in my database and it is formatted with a "." separating the numbers. ie: 555.555.5555
When I echo this variable on a web site one of the macs I am using doesn't allow you to click on the number while the xp machine does. I am thinking I just need to reformat the string to make it something the mac can understand. I tried using str_replace to replace the "." with "-" but I get the same problem.
$ActivevPhone is the variable for the phone number I am echoing.
How would I go about doing this?
Thanks in advance!
When I echo this variable on a web site one of the macs I am using doesn't allow you to click on the number while the xp machine does. I am thinking I just need to reformat the string to make it something the mac can understand. I tried using str_replace to replace the "." with "-" but I get the same problem.
$ActivevPhone is the variable for the phone number I am echoing.
How would I go about doing this?
Thanks in advance!
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote




|