Re: preventing output dump of passthru()
| From: | David Nicholson | Date: | Wed, 06 Aug 2003 00:11:42 +0000 |
| Subject: | Re: preventing output dump of passthru() | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-158375@lists.php.net to get a copy of this message | ||
Hello,
This is a reply to an e-mail that you wrote on Wed, 6 Aug 2003 at
00:56, lines prefixed by '>' were originally written by you.
> Hello,
> Trying to prevent the output dumping of passthru() and instead
store
> the
> output in a variable.
> I read an article that suggested this:
> ob_start();
> passthru("command");
> $output =3D ob_get_contents();
> ob_end_clean();
> But that didn't work. Is there *ANY* way to achieve what I want?
What you put above should work, but how about...
$output = array();
exec("command",$output);
$output = implode("",$output);
(see http://uk.php.net/implode and
http://uk2.php.net/manual/en/function.exec.php)
All the best,
David.
--
phpmachine :: The quick and easy to use service providing you with
professionally developed PHP scripts :: http://www.phpmachine.com/
Free PHP error handling script: www.phpmachine.com/error-handler/
Professional Web Development by David Nicholson
http://www.djnicholson.com/
QuizSender.com - How well do your friends actually know you?
http://www.quizsender.com/