note 32278 added to function.preg-replace

From: Date: Thu, 22 May 2003 12:15:02 +0000
Subject: note 32278 added to function.preg-replace
Groups: php.notes 
Request: Send a blank email to php-notes+get-48814@lists.php.net to get a copy of this message
My users can edit web content online so I needed a way to strip out all of the PHP code (in case they try). This function seemed to work nicely. function stripPhp($phpstring) { return preg_replace("'<\?php.*?\?>'", "\n<!-- PHP CODE REMOVED -->\n",$phpstring); } ---- Manual Page -- http://www.php.net/manual/en/function.preg-replace.php Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+32278 Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+32278&report=yes Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+32278&report=yes

« previous php.notes (#48814) next »