If anyone is looking for a good template engine for php, ecspecially you new people, I would recommend smarty. Not that its new, but it has some cool features including conditional and looping logic in the templates. It also has caching and a bunch of other useful features, you can check it out at:
http://smarty.php.net
I would urge you that if you really want to create a templating engine, check to see if smarty doesnt already fulfill your needs. It really would make no sense to re-invent the wheel, unless the templating technology you implement is very unique to you or critical to your business process.