如果我使用這個鏈接:http://socialgraph.apis.google.com/lookup?q=twitter.com&fme=1&edi=1&edo=1&pretty=1&callback=twitter我得到:如何json_decode原始json數據?
twitter({
"canonical_mapping": {
"twitter.com": "http://twitter.com/"
},
"nodes": {
"http://twitter.com/": {
"attributes": {
"fn": "Mysteriously Unnamed"
},
"claimed_nodes": [
],
"unverified_claiming_nodes": [
"http://7502112.appspot.com/aldiRN",
"http://a.danteng.me/BimaVii",
"http://a.danteng.me/iamsccb",
"http://a.danteng.me/kuiperdagne",
"http://a.danteng.me/lezzchow",
.....
我怎樣才能通過這個閱讀?
我已經tryed
$link = 'http://socialgraph.apis.google.com/lookup?q=exploretalent.com%2F&fme=1&edi=1&edo=1&pretty=1&callback=exploretalent';
$socialapi = @file_get_contents($link);
$social_api = json_decode($socialapi, true);
var_dump ($social_api);
,但我得到:<pre class='xdebug-var-dump' dir='ltr'><font color='#3465a4'>null</font>
有沒有辦法將其轉換爲一個數組?
感謝
成功。謝謝。如果我在那裏留下「漂亮」的元素並不重要。看起來仍然有效。 – Patrioticcow
@Patrioticcow我建議你刪除它:它會給你的帶寬和他們的帶寬增加空白。 –