PHP code example of torann / dom-parser

1. Go to this page and download the library: Download torann/dom-parser 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/ */

    

torann / dom-parser example snippets


use Torann\DomParser\HtmlDom;

$dom = HtmlDom::fromString($str);

$elements = $dom->find($el_name);


use Torann\DomParser\HtmlDom;

$dom = HtmlDom::fromFile($file_name);

$elements = $dom->find($el_name);