PHP code example of hugsbrugs / php-xpath

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

    

hugsbrugs / php-xpath example snippets



use Hug\Xpath\Xpath as Xpath;

Xpath::extract_all($html, $query = '//a');

Xpath::extract_first($html, $query = '//body//h3');

Xpath::get_body($html);

Xpath::replace_body($html, $new_body = '<div>Hello World !</div>');

Xpath::extract_style($html, $query = '//body//div[@class="inscriptionadsl"]', $style_property = 'height');

Xpath::extract_iframe($html, $domain = 'hugo.maugey.fr');

composer 

phpunit --bootstrap vendor/autoload.php tests