I'm trying to take out files out of an Array that defined like this:
$arr[$j][$player_number]['field_name'];
I have 2 fields in the array : names and rating. The output when I'm printing the array is :
Array ( [$j] => Array ( [names] => "some name" [rating] => "some number" ))
My problem is that I can't take the fields "names" and "rating" at the same loop when I'm doing "for each". When I'm doing it separately - it works but I can't sort it in a table normally. I know that I have to use the "list" in some way, I tried to execute it, but without success.
What I'm doing is :
function get_array_column($array, $column)
{
$ret = array();
foreach ($array as $row) $ret[] = $row[$column];
return $ret;
}
for($i=1;$i<=$num_groups;$i++)
{
$a = array();
$a = get_array_column($arr[$i],'names');
foreach ($a as $value)
{
echo $value;
}
}
Thanks.