''debecated:parse_str():在没有结果参数的情况下调用parse_str()在“
我想使用EXEC运行以下命令,但我会遇到错误。那我应该使用什么呢?
php /var/.../../example.php -- 123456789 exampleData1 exampleData2
错误:
Deprecated: parse_str(): Calling parse_str() without the result argument is deprecated in /var/.../../example.php on line X
我尝试了此:
$argumentsArray = [
'postID' => 123456
'foo' => 'bar'
];
exec(php /var/.../../example.php -- $argumentsArray);
and;
parse_str(parse_url($argv[0], PHP_URL_QUERY),$arguments);
$postID = $arguments['postID'];
错误:注意:未定义的索引:postid in ..
I want to run the following command with exec but I am getting an error. So what should I use instead?
php /var/.../../example.php -- 123456789 exampleData1 exampleData2
Error:
Deprecated: parse_str(): Calling parse_str() without the result argument is deprecated in /var/.../../example.php on line X
I tried this:
$argumentsArray = [
'postID' => 123456
'foo' => 'bar'
];
exec(php /var/.../../example.php -- $argumentsArray);
and;
parse_str(parse_url($argv[0], PHP_URL_QUERY),$arguments);
$postID = $arguments['postID'];
Error: Notice: Undefined index: postID in..
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您不能将整个数组替换为字符串。使用
umpode()
将数组转换为带有定界符的字符串。You can't substitute an entire array into a string. Use
implode()
to convert an array into a string with a delimiter between the values.