Re: strip from <html to closing body tag
| From: | S. Murali Krishna | Date: | Mon, 07 Jan 2002 11:23:56 +0000 |
| Subject: | Re: strip from <html to closing body tag | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-79674@lists.php.net to get a copy of this message | ||
Hi,
Ur quest is not clear.
Whether u want to delete everything upto <body> tag or only <html> tags
up to body tag.
anyway this might work for the former.
$parsed = preg_replace("/\\n/","",$html); // to remove '\n' in HTML
file
$parsed = preg_replace("/^(<html>.*)(<body.*)/","\\2",$parsed); // to
remove string upto "<body>" tag
Thanks.
On Mon, 7 Jan 2002, WB wrote:
> Hi,
> Hi i need to strip out the <html> up to the <body> tag.
> For some reason, my function,
> preg_replace( "/<html(.*)body(.*)>" , " " , $body );
> does not work.
> Ok I am not really brilliant at regular expressions ...
>
> Help?
>
> Jay
S.Murali Krishna
smk_bk@yahoo.com
=====================================
We grow slow trying to be great
- E. Stanley Jones
-------------------------------------