Re: Funny php://stdout behaviour
| From: | Toby Butzon | Date: | Wed, 24 Jan 2001 21:33:46 +0000 |
| Subject: | Re: Funny php://stdout behaviour | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-36483@lists.php.net to get a copy of this message | ||
> >One thing that occurs to me -- stdout starts off by being
the browser, so
> >it's kinda funky to open it -- You've already got it
open... I *think* it
> >really only makes sense to fopen() stdout from the
command line. At least,
> >I'm not clear on what it would mean to open it from a
HTTP environment...
>
> You may be right, it's quite weird. The use it was
intended for was to generate
> an HTML page on the fly or a static one, according to
certain conditions.
Perhaps, then, you might use a function which would decide
what to do and use the appropriate method... for ex:
function foo($out) {
if (USE_STDOUT) {
echo $out;
} else
fopen($file, $mode);
// write to file and close it
}
}
Just an idea; may not be anything like what you need but I
thought I'd throw it out there ;)
--Toby