note 105568 added to features.commandline
| From: | Kodeart at osu1 dot php dot net | Date: | Mon, 29 Aug 2011 09:03:19 +0000 |
| Subject: | note 105568 added to features.commandline | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-182792@lists.php.net to get a copy of this message | ||
Check directly without calling functions:
<?php
if (PHP_SAPI === 'cli')
{
...
}
?>
You can define a constant to use it elsewhere
<?php
define('ISCLI', PHP_SAPI === 'cli');
?>
----
Server IP: 69.147.83.197
Probable Submitter: 78.157.14.178
----
Manual Page -- http://www.php.net/manual/en/features.commandline.php
Edit -- https://master.php.net/note/edit/105568
Del: integrated -- https://master.php.net/note/delete/105568/integrated
Del: useless -- https://master.php.net/note/delete/105568/useless
Del: bad code -- https://master.php.net/note/delete/105568/bad+code
Del: spam -- https://master.php.net/note/delete/105568/spam
Del: non-english -- https://master.php.net/note/delete/105568/non-english
Del: in docs -- https://master.php.net/note/delete/105568/in+docs
Del: other reasons-- https://master.php.net/note/delete/105568
Reject -- https://master.php.net/note/reject/105568
Search -- https://master.php.net/manage/user-notes.php