Riddler wrote:[color=blue]
> Anyone have an idea about how I could go about writing a function that
> would simply insert a character inbetween each character in a string?[/color]
php$ php -r 'echo preg_replace("/(.)/", "$1 ", "HELLO WORLD"), "\n";'
H E L L O W O R L D
Ah! -- but that might have a final (unwanted?) space. Let me check:
php$ php -r 'echo "[", preg_replace("/(.)/", "$1 ",[color=blue]
> "HELLO WORLD"), "]\n";'[/color]
[H E L L O W O R L D ]
So, I need to remove that last space:
php$ php -r 'echo "[", substr(preg_replace("/(.)/", "$1 ",[color=blue]
> "HELLO WORLD"), 0, -1), "]\n";'[/color]
[H E L L O W O R L D]
Ok now.
Happy Coding :-)
--
Mail to my "From:" address is readable by all at
http://www.dodgeit.com/
== ** ## !! ------------------------------------------------ !! ## ** ==
TEXT-ONLY mail to the whole "Reply-To:" address ("My Name" <my@address>)
may bypass my spam filter. If it does, I may reply from another address!