Anonymous user
Check output device is a terminal: Difference between revisions
Check output device is a terminal (view source)
Revision as of 13:52, 17 November 2017
, 6 years agoAdded section on PHP
(Added Kotlin) |
(Added section on PHP) |
||
Line 240:
False</pre>
=={{header|PHP}}==
<lang php>
if(posix_isatty('/dev/stdout')) {
echo "The output device is a terminal".PHP_EOL;
} else {
echo "The output device is NOT a terminal".PHP_EOL;
}
</lang>
=={{header|Python}}==
Pretty much the same as [[Check input device is a terminal#Python]].
|