Re: Stripping line break characters
| From: | jimw at apache dot org | Date: | Sat, 25 Aug 2001 21:19:44 +0000 |
| Subject: | Re: Stripping line break characters | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-64450@lists.php.net to get a copy of this message | ||
Rory O'Connor <midget@elaris.com> wrote:
> $sql2=str_replace("","\n",$sql2);
> $sql2=str_replace("","\r",$sql2);
you've got the first two arguments backwards.
$sql2=str_replace("\n","",$sql2);
$sql2=str_replace("\r","",$sql2);
or with php4.0.5 (or later):
$sql2=str_replace(array("\n","\r"),"",$sql2);
for more details:
http://www.php.net/manual/en/function.str-replace.php
jim