Jump to content

getting started with domdocument


ludo1960

Recommended Posts

Hi guys,

Just starting to play with PHP Domdocument, only to fail at the very first step:

<?php   

$html = 'test/php/somefile.html' ;

if(!empty($html)){  

      $dom_1 = new domDocument ; 
      $dom_1->loadHTML($html) ; 
      $links = $dom_1->getElementsByTagName('li') ;

      foreach ( $links as $link) {
			// echo $link ;
           echo $link->nodeValue, PHP_EOL;
      }  
}
?>

When I visit it in a browser I get a WSOD, what am I missing?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.