note 38786 added to function.getopt
| From: | Richard at rn2 dot php dot net | Date: | Wed, 07 Jan 2004 02:10:31 +0000 |
| Subject: | note 38786 added to function.getopt | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-63039@lists.php.net to get a copy of this message | ||
There is some surprising (although GNU getopts-compatible) behaviour if an option which expects an
argument does not get one.
Using the example above:
<? $options = getopt("f:hp:"); ?>
invoked as:
myscript.php -h -f -p foo
this will be parsed to the following key-value pairs:
KEY VALUE
h false
f -p
and foo will be left over.
It will *not* do what one might expect:
KEY VALUE
h false
f false
p foo
(See feature request #26818 for a longer explanation)
----
Manual Page -- http://www.php.net/manual/en/function.getopt.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+38786
Delete -- http://master.php.net/manage/user-notes.php?action=delete+38786&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+38786&report=yes
Search -- http://master.php.net/manage/user-notes.php