Re: new line function

From: Date: Fri, 03 Sep 2004 00:21:25 +0000
Subject: Re: new line function
References: 1 2 3 4 5  Groups: php.general 
Request: Send a blank email to php-general+get-195665@lists.php.net to get a copy of this message
On Thu, 02 Sep 2004 01:08:20 -0400, John Holmes <holmes072000@charter.net> wrote:
Curt Zirzow wrote:
$fixed = preg_replace("/(\r?\n)|\r/",'<br />',$oldstring);
on retrosopect.. reading into that regex i get: unix: sets the standard to use \n windows: can't really decide on \r or \n so just uses them both mac: goes oposite of everybody and used \r instead. It seems OS's can simply be described on how they treat EOL, all the rest of the differences are side effects of this behaviour.
Yeah, of course... Think of how secure windows would be if they just used \n! ;)
It certainly could be more stable. I've seen badly coded programs which ignore that the line terminator is two bytes and try to stick strings in blocks of mem one byte too small as a result. Its not common, but every little thing has an effect :P -- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/

« previous php.general (#195665) next »