note 103553 modified in features.commandline by danbrown
| From: | danbrown@php.net | Date: | Wed, 20 Apr 2011 14:27:48 +0000 |
| Subject: | note 103553 modified in features.commandline by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-178995@lists.php.net to get a copy of this message | ||
A simple way to check if script is running from browser or cli.
<?php
if(defined('STDIN') )
echo("Running from CLI");
else
echo("Not Running from CLI");
?>
--was--
A simple way to check if script is running from browser or cli.
if(defined('STDIN') )
echo("Running from CLI");
else
echo("Not Running from CLI");
http://php.net/manual/en/features.commandline.php