Can we get the row index of a column in a 2 dimensional php array. I need to get the index of row as it was in the php array.
<?php
//Demo Array
$ARRAY = arrauy(
"0" => array(
"col1"=>"",
"col2"=>"",
"col3"=>"",
"col4"=>"",
"col5"=>"",
),
"1" => array(
"col1"=>"",
"col2"=>"",
"col3"=>"",
"col4"=>"",
"col5"=>"",
),
"2" => array(
"col1"=>"",
"col2"=>"",
"col3"=>"",
"col4"=>"",
"col5"=>"",
),
"3" => array(
"col1"=>"",
"col2"=>"",
"col3"=>"",
"col4"=>"",
"col5"=>"",
),
"4" => array(
"col1"=>"",
"col2"=>"",
"col3"=>"",
"col4"=>"",
"col5"=>"",
),
);
foreach($ARRAY as $rowkey=>$rowval)
{
foreach($rowval as $colkey=>$colval)
{
echo($rowkey);
}
}
?>