Listing A
<?php // include class file include ("XML/Statistics.php"); // create object $xs = new XML_Statistics(); // define XML string $xml = "<?xml version='1.0'?><cities><city>Paris</city><city>London</city><city>Geneva</ci ty><city>New ty>York</city><city>Shanghai</city><city>Sydney</city></cities>"; // analyze string $xs->analyzeString($xml); // count number of elements echo "String contains " . $xs->countTag() . " elements"; ?>