嗨,在网上搜索,但找不到解决方案。
我会将数据从此URL http://www.google.com/trends/fetchComponent?q=asdf,qwerty&cid=TIMESERIES_GRAPH_0&export=3保存到PHP数组中。
现在我有了这段代码,
<?php
$url = 'http://www.google.com/trends/fetchComponent?q=asdf,qwerty&cid=TIMESERIES_GRAPH_0&export=3';
$c = curl_init($url);
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
$responsedata = curl_exec($c);
curl_close($c);
echo $responsedata;
?>
但似乎不起作用。
有人能帮我吗?
最佳答案
其JSON
remove // Data table response
google.visualization.Query.setResponse
和
);
然后http://php.net/json_decode