php-general | 2003022
Date: 02/28/03
- Next message: Mark: "[PHP] Re: [PHP-DB] Making Join"
- Previous message: Michael Zornek: "[PHP] A PHP page counter / statistics app"
- In reply to: Jeff Bearer: "[PHP] Redirecting STDOUT to a file pointer"
- Next in thread: Chris Edwards: "[PHP] good database design tool?"
- Reply: Chris Edwards: "[PHP] good database design tool?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Argh, I was thinking about the problem backwards, redirect the fp to stdout
is the way to do it.
if(!$argv[1]) $argv[1] = "php://stdout";
$fp = fopen($argv[1], "w");
fputs($fp,"blah\n");
fclose($fp);
On Fri, 2003-02-28 at 15:11, Jeff Bearer wrote:
> I'm working on a shell script in php. The script has an option to write
> to standard output, or to a file. If the filehandle is opened I'd like
> to redirect standard output to the file pointer. This would allow me
> not to have to handle every output statement twice, once with an echo
> and again with an fputs.
>
> Can this be done in PHP?
>
>
> --
> Jeff Bearer, RHCE
> Webmaster, PittsburghLIVE.com
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
-- Jeff Bearer, RHCE Webmaster, PittsburghLIVE.com-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
- Next message: Mark: "[PHP] Re: [PHP-DB] Making Join"
- Previous message: Michael Zornek: "[PHP] A PHP page counter / statistics app"
- In reply to: Jeff Bearer: "[PHP] Redirecting STDOUT to a file pointer"
- Next in thread: Chris Edwards: "[PHP] good database design tool?"
- Reply: Chris Edwards: "[PHP] good database design tool?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

