regex: delete white characters

Tumpdueddergo

New Member
I try to delete more then one white characters from my string:\[code\]$content = preg_replace('/\s+/', " ", $content); //in some cases it doesn't work\[/code\]but when i wrote \[code\]$content = preg_replace('/\s\s+/', " ", $content); //works fine\[/code\]could somebody explain why?because when i write \[code\]/\s+/\[/code\] it must match all with one or more white character, why it doesn't work?Thanks
 
Back
Top