Ok, in that case, your best bet would be to convert the document to a php file and use that as an include file. Either that of use a proper php templating engine. There are many to choose from, the most popular being Smarty, RainTPL and the more recent Twig (which is REALLY cool).
For example, a twig html document would look like this:
How many are you talking about?
I can't see an easy way around this. Replacing just the if blocks could become a nightmare. It could also be the case where if conditions are a little more complex in some templates, so that your replacement fails.
A few hours converting these files manually may be quicker than writing a fance preg_replace routine that is likely to fail anyway.
There are about 30 files. And as I said these files are being used in other ways / other system. So modification of these files will create duplication, and when a single word in a file need to change, We will have to make these changes in my PHP files too.
To resolve this issue I wanted to use files as these files are provided to me.