Jump to content

Can you include file without outputting?


Anti-Moronic

Recommended Posts

I have a strange dilemma. I am building a simple template system (very very simple)...

 

I am defining the title tag, keywords etc. in the body files and was wondering, is there any way of including this file first BEFORE the head, so I can use those variables in the head.

 

Is there any way to do this? Basically, all I want to do is extract php variables from a file, not output the actual file.

 

any help is greatly appreciated.

Link to comment
https://forums.phpfreaks.com/topic/181424-can-you-include-file-without-outputting/
Share on other sites

ok, I'm trying to use output buffering but it just doesn't seem to be working:

 

<?php

ob_start();
echo 'hello';


?>

 

The above is still outputting immediately and I haven't even flushed. I'm using wamp and output buffering is turned on. Should this be happening?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.