Link to home
Start Free TrialLog in
Avatar of interclubs
interclubs

asked on

Extract Body from HTML Page (PHP)

I'm looking for a case insensitive regex to extract a body tag from a page. I want it to get return the entire opening body tag and anything in it, such as :
<body link="#000000">
<body some stuff here>
ASKER CERTIFIED SOLUTION
Avatar of Hube02
Hube02
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of gr8gonzo
If you're going to be parsing through the contents of the body at all, you may also want to check out this:

http://simplehtmldom.sourceforge.net/

It's pretty handy and I've found it far more reliable than regexes for pattern-matching HTML elements, extracting their attributes, etc...