note 117264 added to reserved.variables.argv
| From: | KRowe | Date: | Tue, 12 May 2015 09:55:14 +0000 |
| Subject: | note 117264 added to reserved.variables.argv | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-202503@lists.php.net to get a copy of this message | ||
Improves on hamboy75's note by providing better support for positional arguments:
foreach ($argv as $arg) {
$e=explode("=",$arg);
if(count($e)==2)
$_GET[$e[0]]=$e[1];
else
$_GET[]=$e[0];
}
var_dump($_GET);
Using this modification, arguments without an = are treated as positional (this is not web standard
but generally works).
----
Server IP: 72.52.91.14
Probable Submitter: 98.214.146.140
----
Manual Page -- http://php.net/manual/en/reserved.variables.argv.php
Edit -- https://master.php.net/note/edit/117264
Del: integrated -- https://master.php.net/note/delete/117264/integrated
Del: useless -- https://master.php.net/note/delete/117264/useless
Del: bad code -- https://master.php.net/note/delete/117264/bad+code
Del: spam -- https://master.php.net/note/delete/117264/spam
Del: non-english -- https://master.php.net/note/delete/117264/non-english
Del: in docs -- https://master.php.net/note/delete/117264/in+docs
Del: other reasons-- https://master.php.net/note/delete/117264
Reject -- https://master.php.net/note/reject/117264
Search -- https://master.php.net/manage/user-notes.php