我有这个功能并且收到这个错误
Warning: array_merge(): Argument #1 is not an array in
$diff = array_merge($followers['ids'], $friends['ids']);
然后
Invalid argument supplied for foreach() in
功能:
public function addtosystemAction(){
$this->_tweeps = new Application_Model_Tweeps();
$http = new Zend_Http_Client();
$http->setUri('http://api.twitter.com/1.1/followers/ids.json?cursor=-1&screen_name=testuser');
$followers = Zend_Json::decode($http->request()->getBody(), true);
$http->setUri('http://api.twitter.com/1.1/friends/ids.json?cursor=-1&screen_name=testuser');
$friends = Zend_Json::decode($http->request()->getBody(), true);
$diff = array_merge($followers['ids'], $friends['ids']);
$resultArray = array();
foreach ($diff as $id){
if(FALSE == $this->_tweeps->checkExisting($id)){
$resultArray[] = $id;
if(count($resultArray) == 50){
break;
}
}
}
为什么我会收到此错误的任何提示?