note 71353 added to features.commandline

From: Date: Thu, 23 Nov 2006 17:45:13 +0000
Subject: note 71353 added to features.commandline
Groups: php.notes 
Request: Send a blank email to php-notes+get-120029@lists.php.net to get a copy of this message
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; ?> ---- Server IP: 66.163.161.117 Probable Submitter: 217.30.156.35 ---- Manual Page -- http://www.php.net/manual/en/features.commandline.php Edit -- https://master.php.net/note/edit/71353 Del: integrated -- https://master.php.net/note/delete/71353/integrated Del: useless -- https://master.php.net/note/delete/71353/useless Del: bad code -- https://master.php.net/note/delete/71353/bad+code Del: spam -- https://master.php.net/note/delete/71353/spam Del: non-english -- https://master.php.net/note/delete/71353/non-english Del: in docs -- https://master.php.net/note/delete/71353/in+docs Del: other reasons-- https://master.php.net/note/delete/71353 Reject -- https://master.php.net/note/reject/71353 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#120029) next »