(PHP Extension) StringBuilder GetAfterBetween
Demonstrates the GetAfterBetween 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");
$sb = new CkStringBuilder();
$sb->Append('<abc><person><name>Joe</name></person><company><name>Chilkat Software</name></company></abc>');
// The GetAfterBetween method gets the substring between two arbitrary marker strings, and doesn't
// start searching until the searchAfter string is passed.
// For example, to get the company name in the string above...
$searchAfter = '<company>';
$companyName = $sb->getAfterBetween($searchAfter,'<name>','</name>');
print 'Company Name = ' . $companyName . "\n";
?>
|