PHP code example of mauris / htmlmeta

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

    

mauris / htmlmeta example snippets




use HtmlMeta\Writer;

$writer = new Writer();

$writer->add(new Meta(array('charset' => 'utf8')));
$writer->add(new Meta(array('name' => 'description', 'content' => 'some description')));

echo $writer->render();




use HtmlMeta\Reader;

$reader = new Reader();
$data = $reader->parse(file_get_contents('http://www.nytimes.com/2013/07/09/world/middleeast/egypt.html'));
print_r($data);