#36560 [Bgs]: [chm] bug on function.str-replace.html

From: Date: Tue, 28 Feb 2006 17:07:12 +0000
Subject: #36560 [Bgs]: [chm] bug on function.str-replace.html
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-93770@lists.php.net to get a copy of this message
ID: 36560 User updated by: gruja at phy dot bg dot ac dot yu Reported By: gruja at phy dot bg dot ac dot yu Status: Bogus Bug Type: Strings related Operating System: windows PHP Version: 5.1.2 New Comment: I have tested similar code on bouth windows and unix. Production server is unix, and I use windows machine for developing applications. I have seen this bug first time on unix, and then again at my PC. Actualy I read string from MySQL, then try to remove \n (beacose it shold be all writen in one line for javascript) and to replace it with <br>... Previous Comments: ------------------------------------------------------------------------ [2006-02-28 17:03:29] bjori@php.net Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php Windows uses \r\n not \n ------------------------------------------------------------------------ [2006-02-28 16:50:37] gruja at phy dot bg dot ac dot yu Description: ------------ I have found a bug on page function.str-replace.html [chm date: 2005-05-20]... When I wish to replace new line character it does insert instead. Reproduce code: --------------- $string="aaa bbb"; $string=str_replace("\n", "<br>", $string); print $string; Expected result: ---------------- aaa<br>bbb Actual result: -------------- aaa <br>bbb ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=36560&edit=1

« previous php.bugs (#93770) next »