Task

Demonstrate how to check whether the output device is a terminal or not.



Related task

   Check input device is a terminal


 
if(posix_isatty(STDOUT)) {
    echo "The output device is a terminal".PHP_EOL;
} else {
    echo "The output device is NOT a terminal".PHP_EOL;
}
 