Jump to content


Photo

Include file that has shebang at top


  • Please log in to reply
1 reply to this topic

#1 gkchicago

gkchicago
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 23 March 2006 - 03:59 PM

Hello, I am using php to do some CLI scripting and in the interest of code-reuse I'm trying to include a php file I've already written into a new script.. Problem is that it was written as a CLI application with the shebang (#!/usr/bin/php -q) at the top.

Because the php of the including script reads this as outside the php code it is printed to the command line at the moment the file is included. Is there some way to suppress this output?

#2 gkchicago

gkchicago
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 23 March 2006 - 06:11 PM

Got it, will probably write a wrapper function for this:

ob_start();
include('file.php');
ob_end_clean();





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users