Detect if a PHP script is being run interactively or not
<p>I have a script that is designed to be run both as a web page, and via the console.</p>

<p>Detecting which method was used to invoke the script seems pretty straight forward, but when the script is being run from the console, I need to know if the script is being run interactively or not (user typing commands, or input redirected from a file).</p>

<p><code>php script.php</code>
versus
<code>php script.php &lt; input_file</code></p>

<p>Is this possible?</p>
