RE: [PHP] Standard output (printf) question...
| From: | Richard Black | Date: | Fri, 21 Dec 2001 08:14:59 +0000 |
| Subject: | RE: [PHP] Standard output (printf) question... | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-78432@lists.php.net to get a copy of this message | ||
As far as I'm aware PHP does output to stdout. Whether or not we can
actually access that stream is another question, and one I don't know the
answer to.
However, I do have a suggestion... Have you looked at the output buffering
functions? They seem to implement what you're trying to do...
http://www.php.net/manual/en/ref.outcontrol.php
HTH,
Richy
-----Original Message-----
From: Paul H. Breslin [SMTP:phb@Canadian-Artist.com]
Sent: 21 December 2001 07:40
To: php-general@lists.php.net
Subject: [PHP] Standard output (printf) question...
I'm trying to create a function that will generate output that could go to
either a file or to the current browser directly. To do this I have
something
like:
function GenerateOutput($out)
{
fwrite($out, "Some stuff");
fflush($out);
}
and to call it I tried:
$stdout = fopen("php://stdout", "w");
GenerateOutput($stdout);
But for some reason nothing shows in the browser when I do this.
I can't seem to find information about what output stream "printf" is
actually
writing to. Do we have access to this stream?
Can anyone provide a hint as to why the above doesn't work?
Thanks.
_________________________________________________________________________
Paul H. Breslin http://Canadian-Artist.com
mailto:phb@Canadian-Artist.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net