This is a possible duplicate entry. Unfortunalty i can't figure this out from the other entries on Stackoverflow. So please help, if you can :)
I am playing with a mini statistics script in php, to show some basic statistics.
I have a multidimensional array that looks like this:
$found_data =
array(
array('2011-11-02' => 'mobile'),
array('2011-11-02' => 'mobile'),
array('2011-11-04' => 'mobile'),
array('2011-11-08' => 'Desktop'),
array('2011-11-08' => 'mobile'),
array('2011-11-08' => 'mobile'),
array('2011-11-08' => 'mobile'),
array('2011-11-15' => 'mobile'),
array('2011-11-18' => 'mobile'),
array('2011-11-21' => 'Desktop'),
array('2011-11-23' => 'mobile'),
array('2011-11-28' => 'Desktop'),
array('2011-11-30' => 'mobile')
);
Now i want to represent this data like this:
2011-11-01: 0 from mobile and 0 from desktop
2011-11-02: 2 from mobile and 0 from desktop
...
2011-11-30: 1 from mobile and 0 from desktop
I'm pretty sure you got the idea.
I have tried the following in a lot of variations, but nothing works:
echo count(array_keys($found_data['2011-11-02'], "mobile"));
Any help is much appreciated :)