What's wrong with this php foreach code?
<pre><code>&lt;?php

$sessionTotal = 10;

        for($initial = 1; $initial &lt;= $sessionTotal ; $initial++){
            echo '&lt;input type="text" name="menuItems" size="20" /&gt;&lt;br /&gt;&lt;br/&gt;';
        }

    //I have a if statement here checking if the submit button isset, yada yada, after I press the submit button, it returns this error -&gt; Warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\yada\yada-yada.php on line 43

    foreach($_POST['menuItems'] as $value)
    {
    echo $value;
    }

?&gt;
</code></pre>

<p>It will echo $value after it is submitted. I have a if statement checking if the submit button isset, yada yada, after I press the submit button, it returns this error -> Warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\yada\yada-yada.php on line 43</p>
