Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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://phpjs.org/functions/nl2br/


Here's what's going on behind the scenes in PHP: https://gist.github.com/4372596

(Taken from https://github.com/php/php-src/blob/PHP-5.4.9/ext/standard/s... )




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: