PHP: foreach loop inside a foreach loop for nested arrays -


i'm reporting form errors user nested arrays, because there different groups form , want show errors such:

        echo "<ul>\n";         foreach ($errors $error) {             if (is_array($error)) {                 echo "item ".$i." error(s):\n";                 echo "<ul>\n";                 foreach ($error $itemerror) {                     echo "<li>".$itemerror."</li>\n";                 }                 echo "</ul>\n";             } else {                 echo "<li>".$error."</li>\n";             }             $i++;         }         echo "</ul>"; 

the nested arrays recognized items in nested arrays don't show up, empty sub list echoed.

check case of variable: $itemerror/$itemerror


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -