If you can guarantee that your body tags are lowercase and have no args, 
then I would check out strtok() in the string functions. If your body tags 
are not that easy to match then I suggest you use either a regex or write a 
state machine to parse the string. A good html parsing state machine is in 
the php source for htmlstriptags. Note that Regex's are extremely expensive 
on large strings.

Cheers,

Owen Prime
http://www.noggin.com.au

Shawn McKenzie wrote:

> I've loaded an html file into a string.  What I'd like to do is create two
> new strings:
> 
> first new string with the original string but remove all content from the
> beginning of the file up to and including <body>, and then remove from the
> end of file up to and including </body>
> 
> second new string only containing content after <head> up to and including
> <body>
> 
> Any ideas on simple ways to do this?
> 
> TIA
> -Shawn



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to