nl2br is not working in this case. It does put a br 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
$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]
\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: SV: [PHP] converting str with \n to one line str??
$temp = str_replace(\n,test
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
thanks
4 matches
Mail list logo