note 87224 deleted from features.commandline by danbrown
| From: | danbrown@php.net | Date: | Tue, 25 Nov 2008 15:40:23 +0000 |
| Subject: | note 87224 deleted from features.commandline by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-146914@lists.php.net to get a copy of this message | ||
Note Submitter: paziek at gmail dot com
----
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!