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: 17 years ago
Size: 603 bytes
 

Contents

Class file image Download
<?php
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>';
$mf->each('
    echo "<h1>".get_class($value)."</h1>";
    var_export($value);
    echo "<hr />";
'
);
/*
### See documentation for xArray on more ways to manipulate the data ###
*/
?>