2
我想的JSON在https://api.twitter.com/1/statuses/user_timeline.json?include_entities=true&incslude_rts=0&screen_name=microsoft&count=200&exclude_replies=1&contributor_details=0
與json_decode()
在PHP(解碼作爲一個關聯數組進行解碼,所以第二個參數設置爲TRUE
。json_decode的限制?
的問題是,它似乎沒有做任何事情(沒有錯誤,警告。其一)的數據包含200個微博+一些額外的數據約他們,如果我只獲取比方說50個鳴叫,該json_decode
函數運行成功
所以我的問題是:是json_decode
不能大字符串解碼
編輯:我的代碼:
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url); // $url is the above mentioned URL
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,0);
$content = curl_exec($ch);
print_r(json_decode($content,true));
應該不是問題。發佈您的php代碼 – OptimusCrime 2011-12-20 11:18:07
我不知道是否存在長度上的錯誤,但在PHP <5.2.3中存在深度錯誤:https://bugs.php.net/bug.php?id = 38945。 它可以是你的情況嗎? – 2011-12-20 11:18:54
適合我(PHP 5.3.6)。 – 2011-12-20 11:20:39