Richard Quadling wrote:

> 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.

Check out posix_isatty()


Per Jessen, Zürich (16.4°C)

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to