PHP code example of vaclavvanik / dom-loader

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

    

vaclavvanik / dom-loader example snippets




declare(strict_types=1);

use VaclavVanik\DomLoader;

$dom = DomLoader\DomLoader::loadFile($file);
// or
$dom = DomLoader\DomLoader::loadString($string);



declare(strict_types=1);

use VaclavVanik\DomLoader;

use const LIBXML_PARSEHUGE;

$dom = DomLoader\DomLoader::loadFile($file, LIBXML_PARSEHUGE);
// or
$dom = DomLoader\DomLoader::loadString($string, LIBXML_PARSEHUGE);



declare(strict_types=1);

use DOMDocument;
use VaclavVanik\DomLoader;

$dom = DomLoader\DomLoader::loadFile($file, 0, new DOMDocument('1.0', 'utf-8'));
// or
$dom = DomLoader\DomLoader::loadString($string, 0, new DOMDocument('1.0', 'utf-8'));