You are here: Re: Execute script and catch output « PHP Programming Language « IT news, forums, messages
Re: Execute script and catch output

Posted by Tim Van Wassenhove on 11/15/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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация