KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I want to replace multiple newline characters with one newline character, and multiple spaces with a single space. I tried preg_replace("/\n\n+/", "\n", $text); and failed! I also do this job on the $text for formatting. $text = wordwrap($text, 120, '<br/>', true); $text = nl2br($text); $text is a large text taken from user for BLOG, and for a better formatting I use wordwrap.
Tags (comma-separated)
Save Edits
Cancel