View Single Post
  #5 (permalink)  
Old 10-02-05, 02:25 PM
Richard's Avatar
Richard Richard is offline
Wannabe Coder
 
Join Date: Sep 2005
Location: Oxford, UK
Posts: 239
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by dennispopel
$letters = trim(preg_replace('~([a-z])~i', '\\1 ', 'Friday'));
print_r($letters);

Otherwise there will be an extra space after the last letter.
Also, for more flixability, you could use
PHP Code:

$letters = [b]trim[/b](preg_replace('~([a-z])~i''\\1 '$theString)); 

print_r($letters); 
Then set whatever value you like to $theString.
Reply With Quote