note 76600 added to function.str-replace

From: Date: Sun, 22 Jul 2007 08:28:04 +0000
Subject: note 76600 added to function.str-replace
Groups: php.notes 
Request: Send a blank email to php-notes+get-128811@lists.php.net to get a copy of this message
In order to replace carriage return characters from form inputs, if everything else fails, you can try: <?php $new_text = str_replace(chr(13).chr(10), '_', $original_text); ?> And in order to show the line feeds in a javascript alert, you can do: <?php $new_text = str_replace(chr(13).chr(10), '\n', $original_text); ?> ---- Server IP: 69.147.83.197 Probable Submitter: 77.209.14.13 ---- Manual Page -- http://www.php.net/manual/en/function.str-replace.php Edit -- https://master.php.net/note/edit/76600 Del: integrated -- https://master.php.net/note/delete/76600/integrated Del: useless -- https://master.php.net/note/delete/76600/useless Del: bad code -- https://master.php.net/note/delete/76600/bad+code Del: spam -- https://master.php.net/note/delete/76600/spam Del: non-english -- https://master.php.net/note/delete/76600/non-english Del: in docs -- https://master.php.net/note/delete/76600/in+docs Del: other reasons-- https://master.php.net/note/delete/76600 Reject -- https://master.php.net/note/reject/76600 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#128811) next »