note 22799 deleted from features.commandline by zak

From: Date: Tue, 02 Jul 2002 18:28:34 +0000
Subject: note 22799 deleted from features.commandline by zak
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-32513@lists.php.net to get a copy of this message
How can you tell for sure if a script is running from the command line? In other words, how can I write a script that can be used either from the command line or from a web browser, and know from within the script where it's running? Apache has an $HTTPS environment variable set if you're using HTTPS. Is there any kind of similar variable - $CLI - that I can use to determine if I'm running from the command line?

« previous php.notes (#32513) next »