PHP code example of stounhandj / htmldom-laravel
1. Go to this page and download the library: Download stounhandj/htmldom-laravel 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/ */
stounhandj / htmldom-laravel example snippets
use StounhandJ\HtmldomLaravel\Htmldom;
$html = new Htmldom('https://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>';