Source for file example2.php
Documentation is available at example2.php
require_once 'XML/Statistics.php';
$xml = implode("",file("http://pear.php.net/rss.php"));
// analyze a string instead of a file
$result = $stat->analyzeString ($xml);
if ($stat->isError ($result)) {
die ("Error: " . $result->getMessage ());
echo "Total tags: " . $stat->countTag (). "<br>";
echo "Occurences of item: " . $stat->countTag ('item'). "<br>";
echo "Maximum nesting level: " . $stat->getMaxDepth (). "<br>";
// these are the <item> tags => amount of news entries
echo "Amount of Tags in depth 3: " . $stat->countTagsInDepth (3 ). "<br>";
Documentation generated on Mon, 11 Mar 2019 15:39:20 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|