| Welcome to WebmasterWorld Guest from 188.8.131.52 |
register, login, search, subscribe, help, library, PubCon, announcements, recent posts, open posts,
|Accredited PayPal World Seller|
|Seperate Digits with Forward Slashes|
| 1:59 am on Sep 1, 2008 (gmt 0)|
I need to take a series of numbers and separate them with slashes. Is there a php command I can use in my statement?
| 2:23 am on Sep 1, 2008 (gmt 0)|
You can do it pretty easily with a custom function.
$var_slash = '';
for($i = 0; $i < strlen($var);$i++)
$var_slash .= $var[$i].'/';
| 5:40 pm on Sep 2, 2008 (gmt 0)|
|separate them with slashes |
In your example there you didn't really separate them, matthewamzn, you added a slash after each one. If you just wanted to separate, you could combine a couple of functions:
$number = 643502;
$newNumber = implode('/', str_split($number));
All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
WebmasterWorld ® and PubCon ® are a Registered Trademarks of Pubcon Inc.
© Pubcon Inc. 1996-2012 all rights reserved