For anyone interested I’ve updated my repo with changed syntax, much simpler, improved performance and added docs.
$toc = new PHPTableOfContents($html);
// Output the table of contents
echo $toc->list();
// Output the content
echo $toc->html();
For anyone interested I’ve updated my repo with changed syntax, much simpler, improved performance and added docs.
$toc = new PHPTableOfContents($html);
// Output the table of contents
echo $toc->list();
// Output the content
echo $toc->html();