note 87224 added to features.commandline
| From: | paziek at gmail dot com | Date: | Tue, 25 Nov 2008 11:41:21 +0000 |
| Subject: | note 87224 added to features.commandline | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-146910@lists.php.net to get a copy of this message | ||
In reply to:
Anonymous
26-Oct-2008 05:52
I think, that listing of options is done better this ways:
<?php
// Is it a option? (prefixed with --)
if(substr($arg, 0, 2) === '--') {
$option = substr($arg, 2);
$opt = explode('=', $option, 2);
$ret['options'][$opt[0]] = $opt[1];
continue;
}
?>
As pairs of key=>value
Apart from that - very handy function!
----
Server IP: 82.177.164.100
Probable Submitter: 62.69.210.177
----
Manual Page -- http://www.php.net/manual/en/features.commandline.php
Edit -- https://master.php.net/note/edit/87224
Del: integrated -- https://master.php.net/note/delete/87224/integrated
Del: useless -- https://master.php.net/note/delete/87224/useless
Del: bad code -- https://master.php.net/note/delete/87224/bad+code
Del: spam -- https://master.php.net/note/delete/87224/spam
Del: non-english -- https://master.php.net/note/delete/87224/non-english
Del: in docs -- https://master.php.net/note/delete/87224/in+docs
Del: other reasons-- https://master.php.net/note/delete/87224
Reject -- https://master.php.net/note/reject/87224
Search -- https://master.php.net/manage/user-notes.php