PHP regex replace white space by   if it is following single letter

Alice

New Member
I have user defined string (html formated string to be saved and used in web) and need to find a way to replace each white space which is right after a single letter by \[code\] \[/code\]. For example \[code\]"this is a string"\[/code\] should become \[code\]"this is a string"\[/code\], \[code\]"bla bla b l abla b la blabla"\[/code\] should become \[code\]"bla bla b l abla b la blabla"\[/code\] ...etc...
 
Back
Top