[PHP] Re: Stripping line break characters

2001-08-25 Thread Chris Hayes
Hi! > $sql2=str_replace("","\n",$sql2); > $sql2=str_replace("","\r",$sql2); well that was easy: manual: string str_replace (string needle, string str, string haystack) and you did: str_replace (string str, string needle, string haystack) So better try $sql2=

[PHP] Re: Stripping line break characters

2001-08-25 Thread jimw
Rory O'Connor <[EMAIL PROTECTED]> 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("\

[PHP] Re: Stripping line break characters

2001-08-25 Thread Rory O'Connor
I have been trying similar arrangements, but to no avail. I think it has something to do with the actual string I am checking - it's an SQL statement. I am trying to create a log of SQL statements in a textfile, and the newline/return characters that people put in the TEXTAREA is screwing it up.