2015-10-05 83 views

回答

1

当然你不只是寻找的SimpleXMLElement。

$xml = new SimpleXMLElement(file_get_contents('http://suggestqueries.google.com/complete/search?output=toolbar&hl=en&q=php')); 
var_dump($xml); 

对名称没有使用rawurlencode。

$url = http://suggestqueries.google.com/complete/search?output=toolbar&hl=en&q=' . rawurlencode('php tutorial'); 
+0

谢谢你!但如何获得URL空间查询。 我试过了: $ url = urlencode('....&q = php tutorial'); 但它不工作 –