|
PHP5中文手册
getopt(PHP 4 >= 4.3.0, PHP 5) getopt — Gets options from the command line argument list 说明
array getopt
( string $options
[, array $longopts
] )
Parses options passed to the script. 参数
The options parameter may contain the following elements:
返回值This function will return an array of option / argument pairs or FALSE on failure. 更新日志
范例
Example#1 getopt() Example
<?php Running the above script with php script.php -fvalue -h will output:
Example#2 getopt() Example#2
<?php Running the above script with php script.php -f "value for f" -v -a --required value --optional="optional value" --option will output:
Example#3 getopt() Example#3 Passing multiple options as one
<?php Running the above script with php script.php -aaac will output:
注释
|