Can PHP determine if the STDOUT to a CLI script is being redirected?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi.

Is there a simple way for a CLI based PHP script to determine if its
output is being redirected to a file or piped through a filter (find,
sort, etc.)

I'm using ANSI escape sequences to colour the output (all working very
nicely), but I want to suppress the codes if the output is being
filtered or redirected to a file.

Regards,

Richard Quadling.

-- 
-----
Richard Quadling
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
"Standing on the shoulders of some very clever giants!"

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux