Re: new line function

From: Date: Thu, 02 Sep 2004 05:08:20 +0000
Subject: Re: new line function
References: 1 2 3 4  Groups: php.general 
Request: Send a blank email to php-general+get-195512@lists.php.net to get a copy of this message
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! ;) -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals – www.phparch.com

« previous php.general (#195512) next »