1. Go to this page and download the library: Download mlocati/chm-lib library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
function printTree($tree, $level)
{
if ($tree !== null) {
foreach ($tree->getItems() as $child) {
echo str_repeat("\t", $level).print_r($child->getName(), 1)."\n";
printTree($child->getChildren(), $level + 1);
}
}
}
$chm = \CHMLib\CHM::fromFile('YourFile.chm');
$toc = $chm->getTOC(); // Parse the contents of the .hhc file
$index = $chm->getIndex(); // Parse the contents of the .hhk file
printTree($toc, 0);
$main = \CHMLib\CHM::fromFile('main.chm');
$map = new \CHMLib\Map();
$map->add('sub1.chm', \CHMLib\CHM::fromFile('sub1.chm'));
$map->add('sub2.chm', \CHMLib\CHM::fromFile('sub2.chm'));
$toc = $main->getTOC();
$toc->resolve($map);
// Now the TOC of the main CHM file contains references to the entries in the other two CHM files
printTree($toc, 0);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.