3 ms·
Not disagreeing what you said, but your quoted example of Python implementation of `nl2br` is wrong, the original PHP's implementation did handle all (\r\n, \n\
by tszming 14y ago
Not disagreeing what you said, but your quoted example of Python implementation of `nl2br` is wrong, the original PHP's implementation did handle all (\r\n, \n\r, \n and \r), see: http://php.net/manual/en/function.nl2br.php http://php.net/manual/en/function.nl2br.php & http://phpjs.org/functions/nl2br/ http://phpjs.org/functions/nl2br/
- carbocation 14y agoHere's what's going on behind the scenes in PHP: https://gist.github.com/4372596 https://gist.github.com/4372596 (Taken from https://github.com/php/php-src/blob/PHP-5.4.9/ext/standard/string.c https://github.com/php/php-src/blob/PHP-5.4.9/ext/standard/s... )