note 32468 added to function.getopt
| From: | csnyder at rack1 dot php dot net | Date: | Wed, 28 May 2003 16:07:46 +0000 |
| Subject: | note 32468 added to function.getopt | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-49180@lists.php.net to get a copy of this message | ||
Note that the value assigned to options with no value is always FALSE.
So to test for the presence of an option on the command line, you actually need to do something like
this:
#!/usr/local/bin/php
<?
$options = getopt("abcde");
if ($options['e']===FALSE) print "\nI took e";
?>
----
Manual Page -- http://www.php.net/manual/en/function.getopt.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+32468
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+32468&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+32468&report=yes