We Recommend

Wicked Cool PHP: Real-World Scripts That Solve Difficult Problems Wicked Cool PHP: Real-World Scripts That Solve Difficult Problems
Wicked Cool PHP contains a wide variety of scripts to process credit cards, check the validity of email addresses, template HTML, and serve dynamic images and text.


Posted By

Mikker on 07/23/07


Tagged

include


Versions (?)


Who likes this?

1 person has marked this snippet as a favorite

Mikker


Saving output of include() to a var


Published in: PHP 


I use this instead of file_get_contents() to allow the use of php-tags in the include files.


  1. <?php
  2. include_once($file);
  3. $site = ob_get_clean();
  4.  
  5. print $site;
  6. ?>

Report this snippet 

You need to login to post a comment.