Invalid argument supplied for foreach()

normanbangkok

New Member
I have absolutely no idea what I'm doing wrong right now. I think I'm mentally exhausted, because I'm utterly clueless. Here's the code I'm using:\[code\]if(empty($this->updates) || !is_array($this->updates)) return null;foreach($this->updates as $update)\[/code\]This is failing. HOWEVER, if I do a print_r($this->updates) before the foreach (and after), it works perfectly fine. Why is it that when I try to use it in a foreach it pretends the array doesn't exist?Sample print_r($this->updates):\[code\]Array( [0] = Array ( [id] => 1 [name] => test ) [1] = Array ( [id] => 2 [name] => rawr ))\[/code\]
 
Back
Top