PHP code example of innmind / html

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

    

innmind / html example snippets


use Innmind\Html\Reader\Reader;
use Innmind\Xml\Node;
use Innmind\Filesystem\File\Content;
use Innmind\Immutable\Maybe;

$read = Reader::default();

$html = $read(
    Content::ofString(\file_get_contents('https://github.com/')),
); // Maybe<Node>

use Innmind\Html\Visitor\Elements;

$h1s = Elements::of('h1')($html);