strip php out of html
| From: | Joseph Blythe | Date: | Fri, 23 Nov 2001 03:40:15 +0000 |
| Subject: | strip php out of html | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-75553@lists.php.net to get a copy of this message | ||
Hello,
Is there a way to strip only php code out of an html file? I know about
strip_tags but its going to be alot of work to make the allowable list, as
all I want to strip out is:
<?php ... ?>
I tried like so:
eregi_replace ("<?php include(\"whatever.php\"); ?>", "",
$string);
but it didn't find it suppose because of the escape characters...
Another option would be to find the php code evaluate it and then put the
result back in the correct position, I sort of tried this with not much
luck.
Any ideas..
Regards,
Joseph