PHP Classes

File: index.php

Recommend this page to a friend!
  Classes of Ve Bailovity   Microformats Parser   index.php   Download  
File: index.php
Role: Example script
Content type: text/plain
Description: Example usage
Class: Microformats Parser
Extract microformat data embedded in HTML
Author: By
Last change:
Date: 16 years ago
Size: 603 bytes


Class file image Download
include ('lib/MicroFormatParser.php');

$html = file('testpage.html');
$html = join("\n", $html);

// Instantiate the parser.
$mfParser = new MicroFormatParser();

// Set parser options.
$mfParser->parserSetup (array (
'hcard' => true,
'hreview' => true,
'hcalendar' => true,
'reltag' => true,
// Parse
$mf = $mfParser->parseSource($html);

// Output the resulting xArray
echo '<pre>';
    echo "<h1>".get_class($value)."</h1>";
    echo "<hr />";
### See documentation for xArray on more ways to manipulate the data ###