note 98259 added to function.preg-replace
| From: | bvandale at hotmail dot com | Date: | Fri, 04 Jun 2010 16:47:45 +0000 |
| Subject: | note 98259 added to function.preg-replace | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-169891@lists.php.net to get a copy of this message | ||
I needed a regular expression to remove php tags when importing legacy content. From the comments
on this page I arrived at this:
<\?(php)?[\n\s\r]*.*[\n\s\r]*\?>
Worked like a beaut.
----
Server IP: 69.147.83.197
Probable Submitter: 69.178.189.242
----
Manual Page -- http://www.php.net/manual/en/function.preg-replace.php
Edit -- https://master.php.net/note/edit/98259
Del: integrated -- https://master.php.net/note/delete/98259/integrated
Del: useless -- https://master.php.net/note/delete/98259/useless
Del: bad code -- https://master.php.net/note/delete/98259/bad+code
Del: spam -- https://master.php.net/note/delete/98259/spam
Del: non-english -- https://master.php.net/note/delete/98259/non-english
Del: in docs -- https://master.php.net/note/delete/98259/in+docs
Del: other reasons-- https://master.php.net/note/delete/98259
Reject -- https://master.php.net/note/reject/98259
Search -- https://master.php.net/manage/user-notes.php