*UPDATE 正在返回数据但未输出到浏览器.当我在下面的答案中使用urlencode建议后,当我查看源代码时,它就在那里.**
用这个把头发拉出来.
基于以下链接:
此代码应该可以提取我需要的表数据:
ini_set("display_errors","2");
ERROR_REPORTING(E_ALL);
$contents = file_get_contents('https://api.facebook.com/method/fql.query?query=SELECT vid, owner, title, description, thumbnail_link, embed_html, updated_time, created_time FROM video WHERE owner= *******myID****');
echo $contents;
Run Code Online (Sandbox Code Playgroud)
但是我收到以下错误:
Warning: file_get_contents(https://api.facebook.com/method/fql.query?query=SELECT vid, owner, title, description, thumbnail_link, embed_html, updated_time, created_time FROM video WHERE owner= ******myID*****) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.1 400 Bad Request in /vservers/mywebsite/htdocs/test.php on line 5
Run Code Online (Sandbox Code Playgroud)
谁能看到我做错了什么?
尝试将主线更改为:
$enc = urlencode('SELECT vid, owner, title, description, thumbnail_link, embed_html, updated_time, created_time FROM video WHERE owner= *******myID****');
$contents = file_get_contents("https://api.facebook.com/method/fql.query?query=$enc");
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3487 次 |
| 最近记录: |