Forum Moderators: phranque
For PHP in particular there is a thread here that talks about templating.
A dynamic site in 2 minutes [webmasterworld.com]
That should help you get started.
Whether or not this post is good advice for you depends a lot on your specific needs and abilities. But the best template-driven CMS (or Content Management System) that I know about is Typo3 [typo3.org].
In addition to being template-driven (you can set up sites using html templates with no special markup, and you can customize about 99.5% of the html output), there are existing extensions to the system that allow you to do pretty much exactly what you describe (as long as you are not talking about running each of the separate sites within its own separate hosting account). You can also allow the user to edit their own sites without giving them access to other parts of the system.
On the downside, if you don't need to use it very much, it is powerful and complex, and it takes a correspondingly long time to learn to use it effectively.
-B
PS - it's GPL licensed and free...