|  | Posted by Tim Van Wassenhove on 06/13/67 11:24 
On 2005-08-18, werdna.sivad@gmail.com <werdna.sivad@gmail.com> wrote:> In PHP I need to be able to execute another script from inside another
 > and catch the output.  How do I do this?  The require() and include()
 > functions will execute a script, but it sends the output to the
 > browser, I don't want this.  I need to be able to catch the output and
 > store it in a file or perform logic on it.
 
 ob_start();
 require 'somefile.php';
 $output = ob_get_contents();
 ob_clean();
 
 Be aware that Output Buffering doesn't stop headers being sent out.
 
 --
 Met vriendelijke groeten,
 Tim Van Wassenhove <http://timvw.madoka.be>
  Navigation: [Reply to this message] |