note 75548 added to function.ereg-replace
| From: | xenleire at gmail dot com | Date: | Tue, 05 Jun 2007 05:56:27 +0000 |
| Subject: | note 75548 added to function.ereg-replace | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-127206@lists.php.net to get a copy of this message | ||
how do you replace multiple adjacent newlines to a single newline?
this doesn't work:
$variable = str_replace("(\r\n)+", "\n", $variable);
$variable = str_replace("(\n+", "\n", $variable);
----
Server IP: 203.16.234.20
Probable Submitter: 121.97.251.94
----
Manual Page -- http://www.php.net/manual/en/function.ereg-replace.php
Edit -- https://master.php.net/note/edit/75548
Del: integrated -- https://master.php.net/note/delete/75548/integrated
Del: useless -- https://master.php.net/note/delete/75548/useless
Del: bad code -- https://master.php.net/note/delete/75548/bad+code
Del: spam -- https://master.php.net/note/delete/75548/spam
Del: non-english -- https://master.php.net/note/delete/75548/non-english
Del: in docs -- https://master.php.net/note/delete/75548/in+docs
Del: other reasons-- https://master.php.net/note/delete/75548
Reject -- https://master.php.net/note/reject/75548
Search -- https://master.php.net/manage/user-notes.php