note 81178 deleted from function.getopt by philip
| From: | philip@php.net | Date: | Thu, 07 May 2009 22:30:06 +0000 |
| Subject: | note 81178 deleted from function.getopt by philip | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-154330@lists.php.net to get a copy of this message | ||
Note Submitter: jon at scorpiocomputing dot com
----
It was not obvious to me how to check for the presence of options which do not accept values, but
this will do it:
<?php
$options = getopt('a');
if ( is_null($options['a']) )
echo "-a not present\n";
else
echo "-a present\n";
?>