Re: Re: [PHP] Funny php://stdout behaviour

From: Date: Thu, 25 Jan 2001 08:40:16 +0000
Subject: Re: Re: [PHP] Funny php://stdout behaviour
Groups: php.general 
Request: Send a blank email to php-general+get-36588@lists.php.net to get a copy of this message
Hi Toby: Yes, that's the way I did, but it's not so clean, you have to open each time you write! -- Saludos, Rubén Blanco. ______________________________________________________ A r t e k - 928.52.20.77 - http://www.artek.es >> >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

« previous php.general (#36588) next »