0
IM试图让WordPress的的foreach后Facebook的股数,但..Facebook的图形API - 股数
<?php
$post_url = the_permalink();
$url_changed = urlencode($post_url);
$json = file_get_contents('http://graph.facebook.com/?id=' . $url_changed);
ini_set("allow_url_fopen", 1);
$array = json_decode($json, true);
echo $array['share']['share_count'];
?>
这给了我才ID = “” 错
file_get_contents(http://graph.facebook.com/?id=):无法打开 流:HTTP请求失败! HTTP/1.1 400错误的请求
但如果使用
$json = file_get_contents('http://graph.facebook.com/?id=http://www.google.com');
这样,那么它的工作原理。有人知道解决方法或如何解决问题吗?
谢谢!得到那个工作:)!我假设如果im在foreach循环,那么这是这篇文章当前链接。你也许也知道fb图形api?它没有显示我的帖子数组之前,我已经从图形API浏览器提交此链接 – Rookie