Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

removing whitespace from a string

Status
Not open for further replies.

rjonesX

Technical User
Joined
Jun 18, 2001
Messages
56
Location
US
I tried preg_replace("\s+"," ", $oldstring);

but that isnt really working for me - it gives me an error...

any ideas?
 
Your regular expression is flawed, but easy to fix:
Code:
preg_replace("[b][COLOR=red]/[/color][/b]\s+[b][COLOR=red]/[/color][/b]"," ", $oldstring);

All you needed is the expression delimiters.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top