RE: Formatting numbers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanks. That works perfectly.
David Smith



-----Original Message-----
From: CPT John W. Holmes [mailto:holmes072000@charter.net]
Sent: Thursday, July 24, 2003 3:36 PM
To: David Smith; php-db
Subject: Re:  Formatting numbers


>  I am a little new to PHP, but I am trying to pull numbers from a database
> that has both phone numbers and social security numbers for a client. My
> Client doesn't want the numbers to come out like 5555555555 but (555)
> 555-5555. My question is can I use format_number() to do this and if so
how
> do I make it change from a comma and every three spaces to fit the formats
> above? I know that this is probably pretty simple, but I can't seem to
find
> the answer anywhere (possibly right under my freakin' nose :D).

Use substr() to grab the pieces you want and add formatting around them.

us2.php.net/substr

---John Holmes...


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux