adding spaces to every 3rd character in a string
Moderator: General Moderators
-
mccommunity
- Forum Commoner
- Posts: 62
- Joined: Mon Oct 07, 2002 8:55 am
adding spaces to every 3rd character in a string
I am trying to take a specific string $string=xfm3muedf7uy; and I am trying to find a way to add spaces after every 3 characters $string=xfm 3mu edf 7uy; What is the best way to do this? Thanks. 
- mydimension
- Moderator
- Posts: 531
- Joined: Tue Apr 23, 2002 6:00 pm
- Location: Lowell, MA USA
- Contact:
chunk_split() looks like it may do the trick for ya
http://www.php.net/manual/en/function.chunk-split.php
http://www.php.net/manual/en/function.chunk-split.php
-
mccommunity
- Forum Commoner
- Posts: 62
- Joined: Mon Oct 07, 2002 8:55 am
To My Dimension
Hey man,
You rock.... thanks for your help. This is what I needed.
Mark
You rock.... thanks for your help. This is what I needed.
Mark