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