Re: strip php out of html
| From: | David Robley | Date: | Fri, 23 Nov 2001 03:58:04 +0000 |
| Subject: | Re: strip php out of html | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-75554@lists.php.net to get a copy of this message | ||
On Fri, 23 Nov 2001 14:10, Joseph Blythe wrote:
> 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
It sounds like you want to capture the output of the script - so you just
end up with what you would see in View Source???
Is this a one off thing, or what exactly is the problem you are trying to
solve?
--
David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc
CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA
Always draw your curves, then plot the data.