stream_isatty
Check if the stream is TTY
Function name: stream_isatty()
Applicable version: PHP 5 >= 5.2.4, PHP 7
Function Description: Check whether the given file pointer is associated with a terminal device (i.e. whether it is an interactive terminal).
Usage: bool stream_isatty ( resource $stream )
parameter:
Return value: Return true if the given file pointer is associated with a terminal device, otherwise false.
Example:
In the above example, we use the fopen() function to open a file pointer to a standard input stream and use the stream_isatty() function to check whether the file pointer is associated with a terminal device. According to the return value, we output the corresponding result.