您可能想尝试使用curl而不是file_get_contents来检索数据。curl对错误处理有更好的支持:
// make request$ch = curl_init();curl_setopt($ch, CURLOPT_URL, "http://api.twitter.com/1/statuses/user_timeline/User.json"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $output = curl_exec($ch);// convert response$output = json_depre($output);// handle error; error outputif(curl_getinfo($ch, CURLINFO_HTTP_CODE) !== 200) { var_dump($output);}curl_close($ch);这可以使您更好地了解为什么收到此错误。一个常见的错误是达到服务器上的速率限制。



