PHP CLI 获取*原始*命令行
是否有可能获得 PHP 中输入的准确原始命令行?
$ ./example.php --key1="value" --key2='value' --key3= value-with-leading-double-blank
我现在想如果 value 用单引号或双引号括起来,并且是否键入了空格。显然 implode(' ', $argv[])
不起作用,因为周围的引号和空格已经被删除。
有什么提示吗?
Is it possible to get the exact raw command line in PHP as typed in?
$ ./example.php --key1="value" --key2='value' --key3= value-with-leading-double-blank
I'd like to now if value was enclosed in single or double quotes and if any blanks were typed. Obviously implode(' ', $argv[])
does not work as surrounding quotes and blanks have been stripped already.
Any hints?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论