PHP code example of kalimeromk / update-htmldom

1. Go to this page and download the library: Download kalimeromk/update-htmldom library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

kalimeromk / update-htmldom example snippets


'providers' => array(
    ...
	'Htmldom\HtmldomServiceProvider',
    ...

'aliases' => array(	
    ...
	'Htmldom' => 'Htmldom\Htmldom',
    ...

$html = new \Htmldom('http://www.example.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>';}