[PHP] generate html file based on template file