![]() |
Format Phone Numbers (Addition to string helper) - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22) +--- Thread: Format Phone Numbers (Addition to string helper) (/showthread.php?tid=14351) |
Format Phone Numbers (Addition to string helper) - El Forum - 12-30-2008 [eluser]Iverson[/eluser] In case anybody needs this...(US Phone Numbers) Code: function phone_format($str) Format Phone Numbers (Addition to string helper) - El Forum - 12-30-2008 [eluser]tdktank59[/eluser] Modified it to take any digits after 10 and make them the extension MY_string_helper.php Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); Format Phone Numbers (Addition to string helper) - El Forum - 12-30-2008 [eluser]ray73864[/eluser] what is the resulting format from this? i can probably guess, but then US numbers are formatted differently to Australian phone numbers, very rarely these days do we put the area code inside of brackets for instance, and mobile numbers changes the whole thing too. a lot of our phone numbers have characters in them too (since certain businesses like being fancy like that). Format Phone Numbers (Addition to string helper) - El Forum - 12-30-2008 [eluser]tdktank59[/eluser] [quote author="ray73864" date="1230691146"]what is the resulting format from this? i can probably guess, but then US numbers are formatted differently to Australian phone numbers, very rarely these days do we put the area code inside of brackets for instance, and mobile numbers changes the whole thing too. a lot of our phone numbers have characters in them too (since certain businesses like being fancy like that).[/quote] Well. Basically just change $strPhone to what ever format you would like If you would like to show me an example of an australian phone number ill be More than happy to modify it for you! At the moment the format is (xxx) xxx-xxxx #xxxx (Area) prefix - number #extension Format Phone Numbers (Addition to string helper) - El Forum - 12-31-2008 [eluser]Milos Dakic[/eluser] Here is how most numbers are formated home phones (00) 0000-0000 mobiles 000 000 000 0 The fancy numbers that ray73864 was talking about, are things like: 13 POND (13 76 63) 1300 NUMBER (1300 50 10 50) Format Phone Numbers (Addition to string helper) - El Forum - 01-01-2009 [eluser]ray73864[/eluser] over here in Western Australia, we format phone numbers as (we ignore the brackets and dashes completely): Home/Fax: 00 0000 0000 Mobile: 0000 000 000 |