Allmost, but you have to look for the \r ass well!
With str_replace you can use an array as the search argument. Like this
$arrReplace = array ("\n","\r");
$temp = str_replace($arrReplace,"",$temp);
$temp = addcslashes($temp,"'"); // just to make sure that the string will
work as my JS string
th
ought - \r\n?
try stripping out \r's as well. windows does \r\n (carriage return, line
feed) for text, unix only \n's
-Original Message-
From: Jens Schodt [mailto:[EMAIL PROTECTED]]
Sent: August 21, 2001 3:20 PM
To: 'Tyler Longren'
Cc: '[EMAIL PROTECTED]'
Subject
$temp = str_replace("\n","test",$temp) is doing the same thing. It is still
a string in several lines if you look in the source :-(
jens
-Oprindelig meddelelse-
Fra: Tyler Longren [mailto:[EMAIL PROTECTED]]
Sendt: 20. august 2001 20:20
Til: Jens
Cc: [EMAIL PROTECTED]
Emne: Re: [PHP] con
nl2br is not working in this case. It does put a with every new line,
but it does not remove the new line. The string will still have the line
changes and it will not work in Javascript.
Jens
-Oprindelig meddelelse-
Fra: Artwithin [mailto:[EMAIL PROTECTED]]
Sendt: 20. august 2001 20:09
4 matches
Mail list logo