Re[2]: [PHP] A simple question, however it's urgent

From: Date: Mon, 17 May 2010 12:36:07 +0000
Subject: Re[2]: [PHP] A simple question, however it's urgent
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-305279@lists.php.net to get a copy of this message
Hey Ash, I do a print_r($_POST) and see there the \r\n's. Please don't pay attention to question marks, there is some Cyrillic here: Original POST: Array ( [uwork] => asdfsadf\r\nasdfasdf\r\nasdfasdf\r\nasdfasdf\r\nasdfasdf\r\nasdf [lid] => 23 [stud] => 1587 [sfac] => 3 [stid] => 9 [report] => 0 [Add] => ????? ?????? ) Modified POST: Array ( [uwork] => asdfsadf\r\nasdfasdf\r\nasdfasdf\r\nasdfasdf\r\nasdfasdf\r\nasdf [lid] => 23 [stud] => 1587 [sfac] => 3 [stid] => 9 [report] => 0 [Add] => ????? ?????? ) -- With best regards from Ukraine, Andre Skype: Francophile; Wlm&MSN: arthaelon @ yandex.ru; Jabber: arthaelon @ jabber.org Yahoo! messenger: andre.polykanine; ICQ: 191749952 Twitter: m_elensule ----- Original message ----- From: Ashley Sheridan <ash@ashleysheridan.co.uk> To: Andre Polykanine <andre@oire.org> Date: Monday, May 17, 2010, 3:24:37 PM Subject: [PHP] A simple question, however it's urgent On Mon, 2010-05-17 at 15:26 +0300, Andre Polykanine wrote: > Hello everyone, > Just can't imagine what happens. There is the simplest function in the > world: > > function LineBreaks ($str) { > $what=array("\r\n", "\n", "\r"); > $with=array("<br>"); > $str=str_replace($what, $with, $str); > return $str; > } > > And... it does work on one site and doesn't on another. Same hosting > provider, same settings, all the same. > When I call > $_POST['uwork']=LineBreaks($_POST['uwork']); > Nothing happens. Yes, it does see \r\n's but it doesn't replace them > with <br>'s. Tried built-in nl2br(), but no result... > Thank you!.. > > -- > With best regards from Ukraine, > Andre > Http://oire.org/ - The Fantasy blogs of Oire > Skype: Francophile; Wlm&MSN: arthaelon @ yandex.ru; Jabber: arthaelon @ jabber.org > Yahoo! messenger: andre.polykanine; ICQ: 191749952 > Twitter: http://twitter.com/m_elensule > > If nl2br() doesn't even work, are you really sure that those character exist in the string? Just for our own sake, could you demonstrate how you determine that the carriage return and line break characters exist in the string? Thanks, Ash http://www.ashleysheridan.co.uk

« previous php.general (#305279) next »