Example:
$myTable = array ( "firstrow" => array ( "col1"=>12, "col2"=>23), "secondrow" => array ( "col1"=>18, "col2"=>36), "thirdrow" => array ( "col1"=>25, "col2"=>78) );
if i want to loop on the first []:
$myTable[???]['col1']
how can i do ?
thx for any help,
There's two methods...
1)
<?
while (list($key, $val)=each ($MyTable)) { echo $key.$val; } ?>
or
$keys=array_keys($MyTable);
for ($i=0; $i<sizeof($keys); $i++) { echo $keys[$i].$MyTable[$keys[$i]] } ?>
Both of these would do the same thing.
nt