PHP code example of malenki / microdata

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

    

malenki / microdata example snippets


use \Malenki\Microdata;
$md = new Microdata('http://www.some-url.com/path/page.html');
//or
$md = new Microdata($some_content, Microdata::AS_STRING);
var_dump($md->extract());

use \Malenki\Microdata;
$md = new Microdata('http://www.some-url.com/path/page.html');
print($md);

use \Malenki\Microdata;
$md = new Microdata('http://www.some-url.com/path/page.html');
var_dump($md->getAllTypeCount());

use \Malenki\Microdata;
$md = new Microdata('http://www.some-url.com/path/page.html');
$md->availableChecking(); // no arg: it takes JSON from official website
//or
$md->availableChecking('all.json'); // arg: it takes JSON from file system
print($md); // If errors found, they will be present into the returned JSON