note 32278 deleted from function.preg-replace by sniper
| From: | sniper@php.net | Date: | Sun, 07 Sep 2003 21:56:20 +0000 |
| Subject: | note 32278 deleted from function.preg-replace by sniper | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-55668@lists.php.net to get a copy of this message | ||
Note Submitter: jim@jeepcrazed.com
----
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);
}