function.array-diff problems!

Posted by SKY on Stack Overflow See other posts from Stack Overflow or by SKY
Published on 2010-04-25T05:54:43Z Indexed on 2010/04/25 6:03 UTC
Read the original article Hit count: 166

Filed under:
|

Hi, im currently getting these error on my site:

Warning: array_keys() [function.array-keys]: The first argument should be an array on line 43

Warning: Invalid argument supplied for foreach() on line 44

Warning: array_diff() [function.array-diff]: Argument #1 is not an array on line 47

Warning: array_diff() [function.array-diff]: Argument #1 is not an array on line 48

And the source are:

42.        $tmp = $this->network->get_user_follows($this->user->id);
43.     $tmp    = array_keys($tmp->followers);
44.     foreach($tmp as &$v) { $v = intval($v); }
45.     $tmp2   = array_keys($this->network->get_group_members($g->id));
46.     foreach($tmp2 as &$v) { $v = intval($v); }
47.     $tmp    = array_diff($tmp, $tmp2);
48.     $tmp    = array_diff($tmp, array(intval($this->user->id)));

I want to know what is the problem and how i fix it. Thanks!

© Stack Overflow or respective owner

Related posts about php

Related posts about arrays