如何从 php 运行 wget 以便输出显示在浏览器窗口中?
最佳答案
您可以使用 file_get_contents反而。更容易。
echo file_get_contents('http://www.google.com');
如果你必须使用wget,你可以尝试如下:
$url = 'http://www.google.com';
$outputfile = "dl.html";
$cmd = "wget -q \"$url\" -O $outputfile";
exec($cmd);
echo file_get_contents($outputfile);
关于php - 如何从 php 运行 wget 以便输出显示在浏览器窗口中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2528466/