justuptime.com - monitor your servers & websites

Regular expression woes.

You are viewing this site as a guest. Join our community to get your questions answered and share knowledge. Active members may advertise and ask for a website critique.

They have: 15 posts

Joined: Dec 2006

<?php
if (preg_match("/<body(.*)>(.*)<\/body>/i\",$val, $body))
{
    @$page_contents = $body[2];
    @$is_contents = true;
}
?>

To cut a long story short, I'm trying to grab everything between the body tags of a webpage. I'm still a novice when it comes to regular expressions.

That should work, right?