I have this array
[multiv] => Array
(
[31603] => Array
(
[0] => one
[1] => two
[2] => three
[3] => four
)
[18992] => Array
(
[0] => five
[1] => six
[2] => seven
[3] => eight
)
)
which i want to display all its elements and every array key together using an article tag.I have this
foreach( $main_array['multiv'] as $key => $value ) {
foreach( $value as $k => $v ) {
echo "
<article class='crud_list'>
<input type='hidden' name='$key' />
<input type='text' name='$k' value='$v' /><br/>
<input type='checkbox' name='$k' value='$v' /><br/>
<input type='radio' name='$k' value='$v' /><br/>
<select><option>$k</option></select><br/>
</article>
";
}
}
but the problem is the code outputs eight article tags in total.The first foreach gets the array keys of the top array but how do i do to get the values 0,1,2,3 in one article such that now i will only have two article tags for the array?.