Skip to content

Extract microdata from HTML using PHP. Based on foolip's MicrodataJS implementation of the Microdata DOM API.

License

Notifications You must be signed in to change notification settings

zoonru/microdata-php

 
 

Repository files navigation

MicrodataPHP (forked)

composer require zoon/microdata-php

Microdata is a syntax for embedding machine-readable metadata in HTML.

MicrodataPHP is a PHP library for extracting microdata from HTML documents. It is inspired by MicrodataJS, which is inspired by the native Microdata DOM API.

Example use:

require 'vendor/autoload.php';

use Zoon\MicrodataPHP\MicrodataPhp;

$url = 'http://example.com';
$md = new MicrodataPhp($url);
$data = $md->obj();

// Get a property of a top level item.
print $data->items[0]->properties['name'][0];

// Get a property of a nested item.
print $data->items[0]->properties['hiringOrganization'][0]->properties['name'][0];

About

Extract microdata from HTML using PHP. Based on foolip's MicrodataJS implementation of the Microdata DOM API.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 88.6%
  • HTML 11.4%