(PHP Extension) SearchAllForContent
Demonstrates the SearchAllForContent method.
<?php
// The version number (9_5_0) should match version of the Chilkat extension used, omitting the micro-version number.
// For example, if using Chilkat v9.5.0.48, then include as shown here:
include("chilkat_9_5_0.php");
$xml = new CkXml();
$success = $xml->LoadXmlFile('qa_data/xml/pigs.xml');
if ($success != true) {
print $xml->lastErrorText() . "\n";
exit;
}
// xBeginAfter is a CkXml
$xBeginAfter = $xml->GetSelf();
// xFound is a CkXml
$xFound = $xml->SearchAllForContent($xBeginAfter,'*pig*');
$searchForMore = true;
while (($searchForMore == true)) {
print $xFound->tag() . "\n";
print $xFound->content() . "\n";
print '--' . "\n";
// xBeginAfter is a CkXml
$xBeginAfter = $xFound;
// xFound is a CkXml
$xFound = $xml->SearchAllForContent($xBeginAfter,'*pig*');
$searchForMore = $xml->get_LastMethodSuccess();
}
?>
|