Welcome to WebmasterWorld Guest from

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Seperate Digits with Forward Slashes

1:59 am on Sep 1, 2008 (gmt 0)

Full Member

10+ Year Member

joined:Jan 27, 2005
posts: 229
votes: 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 Sept 1, 2008 (gmt 0)

Junior Member

10+ Year Member

joined:June 6, 2005
votes: 0

You can do it pretty easily with a custom function.

function slash($var)
$var_slash = '';
for($i = 0; $i < strlen($var);$i++)
$var_slash .= $var[$i].'/';
return $var_slash;

5:40 pm on Sept 2, 2008 (gmt 0)


WebmasterWorld Administrator coopster is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:July 31, 2003
votes: 2

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));

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members