RE: [PHP] strip php tags from code ?
| From: | Timothy Hitchens \(HiTCHO\) | Date: | Sun, 12 Jan 2003 13:22:57 +0000 |
| Subject: | RE: [PHP] strip php tags from code ? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-131330@lists.php.net to get a copy of this message | ||
So you want to remove only the unparsed/raw php script blocks.
Why... are you displaying PHP without parsing??
If this is the case you can write a couple of very simple preg_replace
with a call
back and all is done.
Timothy Hitchens (HiTCHO)
Open Platform Consulting
e-mail: tim@hitcho.com.au
> -----Original Message-----
> From: David D [mailto:david_devidal@yahoo.fr]
> Sent: Monday, 6 January 2003 10:48 PM
> To: php-general@lists.php.net
> Subject: [PHP] strip php tags from code ?
>
>
> I only want to keep html code of a page.
> I want to remove php tags.
> Some tell that strip_tags is not adapted.
>
> sample of what i want to do:
> <html>
> na
> <?php echo 'na';?>
> </html>
> ->
> <html>
> na
> </html>
>
> php tags can be :
> <? ?>or <?= ?>
> or <script language='php'></script> /i
>
> Merci.
>
>
>
> ..
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>