Quote:
Originally Posted by EightyEight
I am trying to keep some code from popping out a foreach error if the array does not exist?
|
Ok, there are a few ways.. Ideally you should declare the variable an array before you use it for anything:
But if for whatever reason you cannot do that then:
Code:
if (is_array($arr))
{
### Foreach