How to check if PHP script is running by shell
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/1991346/in-php-how-to-detect-the-execution-is-from-cli-mode-or-through-browser">In php, how to detect the execution is from CLI mode or through browser?</a>  </p>
</blockquote>



<p>How can I check if a PHP script is running by Shell (command line) or by a server?</p>
