You are here

function html_no_comment in simplehtmldom API 5.2

Same name and namespace in other branches
  1. 6 simplehtmldom/example/simple_html_dom_utility.php \html_no_comment()
  2. 7 simplehtmldom/example/simple_html_dom_utility.php \html_no_comment()

File

simplehtmldom/example/simple_html_dom_utility.php, line 6

Code

function html_no_comment($url) {

  // create HTML DOM
  $html = file_get_html($url);

  // remove all comment elements
  foreach ($html
    ->find('comment') as $e) {
    $e->outertext = '';
  }
  $ret = $html
    ->save();

  // clean up memory
  $html
    ->clear();
  unset($html);
  return $ret;
}