Current Location: Home> Function Categories> stream_isatty

stream_isatty

Check if the stream is TTY
Name:stream_isatty
Category:Stream
Programming Language:php
One-line Description:Check whether the given file pointer is associated with a terminal device (i.e. whether it is an interactive terminal)

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:

  • $stream: File pointer resource, usually obtained through fopen() or fsocckopen() functions.

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.

Similar Functions
Popular Articles