Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php simple html dom

// Important: Look at https://simplehtmldom.sourceforge.io/ on how to set this up.

// Create DOM from URL or file
$html = file_get_html('http://www.google.com/');

// Find all images
foreach($html->find('img') as $element)
       echo $element->src . '<br>';

// Find all links
foreach($html->find('a') as $element)
       echo $element->href . '<br>';
Source by simplehtmldom.sourceforge.io #
 
PREVIOUS NEXT
Tagged: #php #simple #html #dom
ADD COMMENT
Topic
Name
7+8 =