note 105504 added to features.commandline
| From: | Anonymous at osu1 dot php dot net | Date: | Tue, 23 Aug 2011 10:42:32 +0000 |
| Subject: | note 105504 added to features.commandline | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-182672@lists.php.net to get a copy of this message | ||
Instead of all these long and .. interesting .. ways to check if you're running from cli, you
could always do this:
<?php
function isCli() {
return php_sapi_name()==="cli";
}
?>
----
Server IP: 69.147.83.197
Probable Submitter: 83.150.91.151
----
Manual Page -- http://www.php.net/manual/en/features.commandline.php
Edit -- https://master.php.net/note/edit/105504
Del: integrated -- https://master.php.net/note/delete/105504/integrated
Del: useless -- https://master.php.net/note/delete/105504/useless
Del: bad code -- https://master.php.net/note/delete/105504/bad+code
Del: spam -- https://master.php.net/note/delete/105504/spam
Del: non-english -- https://master.php.net/note/delete/105504/non-english
Del: in docs -- https://master.php.net/note/delete/105504/in+docs
Del: other reasons-- https://master.php.net/note/delete/105504
Reject -- https://master.php.net/note/reject/105504
Search -- https://master.php.net/manage/user-notes.php