i have an array $array that prints out something like:
Array
(
[Terry] => Array
(
[2011-10-26] => Array
(
[0] => 69.90
[1] => 69.90
)
)
[Travis] => Array
(
[2011-10-26] => Array
(
[0] => 199.50
)
[2011-10-27] => Array
(
[0] => 199.50
)
)
)
i am trying to place data into a table like this:
NAME 2011-10-26 2011-10-27
Terry 2 0
Travis 1 1
i can get the count like this:
foreach($array as $key => $value){
echo $key; // this will give me the names
foreach($value as $keys => $values){
echo $keys; //this will give me the dates
echo count($values); // this will give me the count per date
}
}
the dates that i get back are like this: 2011-10-26 2011-10-26 2011-10-27
I’ve been playing with this for a while and i run out of ideas.
any help?
Thanks
1 Answer