note 105108 added to function.preg-replace-callback

From: Date: Thu, 28 Jul 2011 07:57:47 +0000
Subject: note 105108 added to function.preg-replace-callback
Groups: php.notes 
Request: Send a blank email to php-notes+get-181951@lists.php.net to get a copy of this message
I noticed that 'e' modifier use addslashed on result <? function wyczysc_strongi($string) { if(mb_strlen($string,'UTF-8')>60) { return $string; } else { return '<strong>'.$string.'</strong>'; } } $tresc = "<strong>fajna dupa's</strong>"; $tresc = preg_replace("/<strong>(.*?)<\/strong>/ie",'wyczysc_strongi("$1")',$tresc); echo $tresc will give: <strong>fajna dupa\'s</strong> ?> solution: $tresc = stripslashes($tresc); after callback ---- Server IP: 69.147.83.197 Probable Submitter: 89.25.186.113 ---- Manual Page -- http://www.php.net/manual/en/function.preg-replace-callback.php Edit -- https://master.php.net/note/edit/105108 Del: integrated -- https://master.php.net/note/delete/105108/integrated Del: useless -- https://master.php.net/note/delete/105108/useless Del: bad code -- https://master.php.net/note/delete/105108/bad+code Del: spam -- https://master.php.net/note/delete/105108/spam Del: non-english -- https://master.php.net/note/delete/105108/non-english Del: in docs -- https://master.php.net/note/delete/105108/in+docs Del: other reasons-- https://master.php.net/note/delete/105108 Reject -- https://master.php.net/note/reject/105108 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#181951) next »