Login   Register  
PHP Classes
elePHPant
Icontem

File: index.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  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: 7 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 ###
*/
?>