我正在使用 PHPshell_exec()
通过命令行执行程序,并将 URL 作为参数传递给它。
问题:程序似乎只接收到参数的截断版本。PHP传递参数
http://www.mysite.com/Men/T-Shirts-Vests/Cat/pgecategory.aspx?cid=7616&parentID=-1&pge=0&pgeSize=200&sort=1
但程序将其接收为
http://www.mysite.com/Men/T-Shirts-Vests/Cat/pgecategory.aspx?cid=7616
我怎样才能防止它在之后被截断&
?
PHP
$url = 'http://www.mysite.com/Men/T-Shirts-Vests/Cat/pgecategory.aspx?cid=7616&parentID=-1&pge=0&pgeSize=200&sort=1';
$script = path('base')."application/phantomjs/httpget.js";
$output = shell_exec("phantomjs $script $url");
httpget.js
// Get URL from command line parameter
var system = require('system');
var url = system.args[1];
console.log(url);
输出
http://www.mysite.com/Men/T-Shirts-Vests/Cat/pgecategory.aspx?cid=7616