What is the best way to include a php file as a template?

Posted by Jon on Stack Overflow See other posts from Stack Overflow or by Jon
Published on 2010-06-02T20:35:13Z Indexed on 2010/06/02 20:44 UTC
Read the original article Hit count: 141

Filed under:
|

I have simple template that's html mostly and then pulls some stuff out of SQL via PHP and I want to include this template in three different spots of another php file. What is the best way to do this? Can I include it and then print the contents?

Example of template:

Price: <?php echo $price ?>

and, for example, I have another php file that will show the template file only if the date is more than two days after a date in SQL.

© Stack Overflow or respective owner

Related posts about php

Related posts about php5