Is it possible, using PHP, to extract the headings (h1, h2, etc.) from a page using PHP, and list them on the same page in an unordered list? A WordPress-specific solution is fine, but a general PHP solution is welcome as well.
EDIT: What I want is something of the form
h1
h2
h3
h3
h2
h3
h3
In php, you could use xml manipulation:
http://www.php.net/manual/en/domdocument.getelementsbytagname.php
Haven’t tested yet, but something like this for h1:
I’m not quite sure on the functions, and I’m not going to be able to test (until probably tomorrow)… I got the tostring from http://br.php.net/manual/en/class.domelement.php#98851