PHP Detect if Script is running from CLI
Apr 1, 2010 · 1 minute readCategory: php
This is post is now quite old and the the information it contains may be out of date or innacurate.
If you find any errors or have any suggestions to update the information please let us know or create a pull request on GitHub
if(!defined('STDIN')){ //its not via command line
// do non command line stuff
}