TagTemplate is a PHP library class for use with template files.
If you have no idea what that means, then this page will be of absolutely no interest to you.
Otherwise, read on...
There are many PHP template libraries available in the Open Source domain, but when I searched I was unable to find solutions to what I thought would be two very simple and common problems:
So I wrote my own.
TagTemplate is a class that performs both of the above tasks, plus a bit more. You decide which via a function parameter.
The best example of the use of the second option is to create a template HTML file that represents the stuff you want to have in every page in your site (such as the logo, the navigation buttons, the copyright message at the bottom, etc), and put some invented tag in it that represents where all the page-specific HTML should go (such as, <MY_BODY>This text inside is ignored</MY_BODY>). Then you make two calls to TagTemplate - the first to retrieve the HTML from before the <MY_BODY> tag, and the second to retrieve all the stuff after the </MY_BODY> tag.
You can download it (in zip format only) here.