note 109848 added to function.nl2br

From: Date: Mon, 27 Aug 2012 15:43:42 +0000
Subject: note 109848 added to function.nl2br
Groups: php.notes 
Request: Send a blank email to php-notes+get-190237@lists.php.net to get a copy of this message
Deleting <br /> from pre block with class? No problem: <?php if(preg_match_all('/\<pre (.*?)\>(.*?)\<\/pre\>/', $sText, $match)) for($i = 0, $count = count($match[0]); $i < $count; $i++) $sText = str_replace('<pre '.$match[1][$i].'>'.$match[2][$i].'</pre>','<pre '.$match[1][$i].'>'.str_replace('<br />', "\n", $match[2][$i]).'</pre>', $sText); ?> ---- Server IP: 69.147.83.197 Probable Submitter: 85.219.133.121 ---- Manual Page -- http://www.php.net/manual/en/function.nl2br.php Edit -- https://master.php.net/note/edit/109848 Del: integrated -- https://master.php.net/note/delete/109848/integrated Del: useless -- https://master.php.net/note/delete/109848/useless Del: bad code -- https://master.php.net/note/delete/109848/bad+code Del: spam -- https://master.php.net/note/delete/109848/spam Del: non-english -- https://master.php.net/note/delete/109848/non-english Del: in docs -- https://master.php.net/note/delete/109848/in+docs Del: other reasons-- https://master.php.net/note/delete/109848 Reject -- https://master.php.net/note/reject/109848 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#190237) next »