note 71353 deleted from features.commandline by nlopess
| From: | nlopess@php.net | Date: | Thu, 23 Nov 2006 18:04:20 +0000 |
| Subject: | note 71353 deleted from features.commandline by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-120030@lists.php.net to get a copy of this message | ||
Note Submitter: Tomek Perlak [tomekperlak tlen pl]
----
I wanted to output some testing information from my script only if I called it as a webpage.
So I was faced with the inevitable question: 'How to tell if the php script is invoked from the
command line?'
Here's the answer:
<?
$run_from_cmd = count($_SERVER['argv']) > 0;
?>