Run PHP script only on command line
Snippet
Posted by kitt at 15:42 on 17 September 2009
In case a PHP script should be run only on the command line, and not in a browser
if (php_sapi_name() != 'cli') { /* do any clean up or logging here */ exit(); }
Source:
Add new comment