Invalid argument for foreach()

Posted by johnny-kessel on Stack Overflow See other posts from Stack Overflow or by johnny-kessel
Published on 2010-05-15T21:16:37Z Indexed on 2010/05/15 21:24 UTC
Read the original article Hit count: 268

Filed under:
|

Error I'm receiving Invalid argument supplied for foreach()

The offending portions is this:

foreach($subs[$id] as $id2 => $data2)

Strange cause I'm using the same construct elsewhere and it works fine.. I'm using it to generate sub-categories and it works but I want to get rid of the error

This is more context

foreach($parents as $id => $data)
        {
            if($x == 0)
            {
                $html .= "<tr width='25%' class='row2'>";
            }

            $shtml = "";

            $i = 0;

            ***foreach($subs[$id] as $id2 => $data2)***
            {
                $i++;
                if($i == 15)
                {
                    $shtml .= $this->ipsclass->compiled_templates[ 'skin_businesses' ]->portal_categories_sub_row( $id2, $data2['cat_name'], 1 ) . "";
                    break;
                }
                else
                    $shtml .= $this->ipsclass->compiled_templates[ 'skin_businesses' ]->portal_categories_sub_row( $id2, $data2['cat_name'], 0 ) . "";
            }

© Stack Overflow or respective owner

Related posts about php

Related posts about foreach