Possible duplicate:
Can PHP determine if it starts from a cron job or from the command line?
I am trying to determine if the STDOUT resource is being transferred on the command line of the PHP script to another command or not in order to display tabular data accordingly (if the output is directly to the terminal, it looks good to have table cells wrapped in borders +-----+ , but not trying to verify this data with awk or another command.)
Having received this answer , I tried to check the STDOUT resource with stream_get_meta_data() and all the other functions that I can find in the PHP manual that works with streams, but in each case the resource looks exactly the same, regardless of whether it is connected to another process or not.
Is there any way to find this in PHP?
source share