Jump to content

Ob_Start() To Ob_Get_Clean() Not Working


MrFish

Recommended Posts

I'm trying to include a php file and dynamically write head tags. My short code looks like this.

ob_start();include($path);$page = ob_get_contents();ob_end_clean();

But the file is included and displayed anyway. I've put an exit() after ob_end_clean() because I echo the page contents and I still see everything. Any ideas?

Link to comment
Share on other sites

Ah you're right! I found in a sidebar include I was trying to use a class that I didn't load. I didn't notice because it would usually break the page but since it didn't inform me I didn't realize. You saved me another hour of rage! :D

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...