I was trying to extract the text of an html tag using regular expressions. It seems that preg_match_all is a good option to do this. I wanted to extract the taxonomy term name from within a views display template. I needed to embed a views inside another views. I needed to use part of the parent view's html as an argument for the nested view. I used preg_match_all to extract the term name from an html tag.
This piece of code is to generate a menu or list of links to taxonomy pages. I used it inside a block. I created a view that shows all items under certain taxonomy term.
It is basically a taxonomy menu but you can customized an place it anywhere.
Good link to learn more about embedding your own views: http://groups.drupal.org/node/10129
Insert snippet into a node's body. Select the php input format and submit the node.
I found it here: http://www.computerminds.co.uk/bulk-deleting-drupal-nodes-particular-content-type