有没有办法将选项定义为包含空格的字符串,如下所示
$myscript.php test --comment="some string"
Run Code Online (Sandbox Code Playgroud)
它输出:
[RuntimeException]
Too many arguments.
test [-c|--comment="..."]
Run Code Online (Sandbox Code Playgroud)
但是,如果--comment不包含空格(例如:"some_string"),则它可以工作.