으로 작동하지 않는 경우 내 트위터 피드가 특정 방식으로 캐시되거나 새로 제공되는지 확인하려고합니다. 아래의 코드를 사용하여 캐싱 된 파일이 오래된 지 여부를 확인하고 동시에 내 트위터 속도 제한에 충분한 시도가 남아 있는지 확인합니다. 문제는 그 진술이 제대로 작동하지 않는 것 같지만, 나는 이유를 알 수 없다. 나는 '& &'연산자와 'AND'연산자를 모두 사용해 보았지만 어느 것도 작동하지 않았습니다. 어떤 생각?명세서가 AND
$json = file_get_contents("http://api.twitter.com/1/account/rate_limit_status.json", true);
$decode = json_decode($json, true);
$twitter_rate_remaining = $decode['remaining_hits'];
if(((time()-filectime($file)) > 1800) && ($twitter_rate_remaining > 5)) { //do something }
SUGGESTION :의 값 에코 "시간() - filectime ($ 파일)"와 "$의 twitter_rate_remaining". 너는 놀랄지도 모르겠다 :) – paulsm4