Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
以这种方式在控制台中调用 PHP 脚本时:
phpscript.php --param1=value --param2=value2
如何检索param1和param2取值?
param1
param2
$argv可用于您的脚本,但更易于使用getopt().
$argv
getopt()
$options = getopt("", array("param1:", "param2:"));