970_90

Tuesday, 2 October 2012

Gets options from the command line argument list

array getopt ( string $options [, array $longopts ] )
Gets options from the command line argument list
Parses options passed to the script.

<?php
$options 
getopt("f:hp:");var_dump($options);?>

5.3.0 Added support for "=" as argument/value separator. 5.3.0 Added support for optional values (specified with "::"). 5.3.0 Parameter longopts is available on all systems. 5.3.0 This function is no longer system dependent, and now works on Windows, too.

See PHP getopt example

No comments:

Post a Comment