Display php array in a HTML Table
<p>My array looks like</p>

<pre><code>Array
(
    [id] =&gt; 1
    [group] =&gt; 343,727
    [lat] =&gt; 12,14
    [lng] =&gt; 20,35  
)
Array
(
    [id] =&gt; 2
    [group] =&gt; 555,7271,888
    [lat] =&gt; 55,32,98
    [lng] =&gt; 99,74,26
)
</code></pre>

<p>I want to put this array into a HTML table in such a way that i should get.</p>

<pre><code>id     group    lat      lng
1       343     12       20
1       727     14       35


id     group    lat   lng
2       555     55    99
2      7271     32    74
2       888     98    26  
</code></pre>

<p>i could loop through one array value</p>

<pre><code>$group = $rs[$i]['group'];
$myArray = explode(',', $group);
foreach($myArray as $key) {
    ?&gt;&lt;tr&gt;&lt;td&gt;&lt;?php echo $key;?&gt;"&lt;/td&gt;&lt;/tr&gt;&lt;?php
}
</code></pre>

<p>This will give.</p>

<pre><code>id     group    lat      lng
        343     
        727     

 id     group    lat      lng
        555     
        7271   
        888   
</code></pre>

<p>How do i loop multiple array values so that i should get my required HTML table format</p>