Posted By

vitruvo on 08/03/11


regex php file html page tag body

Versions (?)

Extract Body

 / Published in: PHP

Easily extract the Content from a HTML Page with this tiny function.

  1. function page_body($url){
  2. $document = file_get_contents($url);
  3. preg_match("/<body[^>]*>(.*?)<\/body>/is", $document, $contents);
  4. $body = $contents[0];
  5. return $body;
  6. }

Report this snippet  

You need to login to post a comment.