Hi,i have the following code,how can i count values -averages per row and column from this code:
<?php
$data = array(
array(""=>"January", "ATL"=>rand(0,335) , "ORD"=>rand(0,335),"LAX"=>rand(0,335),"DFW"=>rand(0,335),"DEN"=>rand(0,335),"JFK"=>rand(0,335),"SFO"=>rand(0,335),"CLT"=>rand(0,335),"LAS"=>rand(0,335),"PHX"=>rand(0,335)),
array(""=>"February", "ATL"=>rand(0,335) , "ORD"=>rand(0,335),"LAX"=>rand(0,335),"DFW"=>rand(0,335),"DEN"=>rand(0,335),"JFK"=>rand(0,335),"SFO"=>rand(0,335),"CLT"=>rand(0,335),"LAS"=>rand(0,335),"PHX"=>rand(0,335)),
array(""=>"March", "ATL"=>rand(0,335) , "ORD"=>rand(0,335),"LAX"=>rand(0,335),"DFW"=>rand(0,335),"DEN"=>rand(0,335),"JFK"=>rand(0,335),"SFO"=>rand(0,335),"CLT"=>rand(0,335),"LAS"=>rand(0,335),"PHX"=>rand(0,335)),
array(""=>"April", "ATL"=>rand(0,335) , "ORD"=>rand(0,335),"LAX"=>rand(0,335),"DFW"=>rand(0,335),"DEN"=>rand(0,335),"JFK"=>rand(0,335),"SFO"=>rand(0,335),"CLT"=>rand(0,335),"LAS"=>rand(0,335),"PHX"=>rand(0,335)),
array(""=>"May", "ATL"=>rand(0,335) , "ORD"=>rand(0,335),"LAX"=>rand(0,335),"DFW"=>rand(0,335),"DEN"=>rand(0,335),"JFK"=>rand(0,335),"SFO"=>rand(0,335),"CLT"=>rand(0,335),"LAS"=>rand(0,335),"PHX"=>rand(0,335)),
array(""=>"June", "ATL"=>rand(0,335) , "ORD"=>rand(0,335),"LAX"=>rand(0,335),"DFW"=>rand(0,335),"DEN"=>rand(0,335),"JFK"=>rand(0,335),"SFO"=>rand(0,335),"CLT"=>rand(0,335),"LAS"=>rand(0,335),"PHX"=>rand(0,335)),
array(""=>"July", "ATL"=>rand(0,335) , "ORD"=>rand(0,335),"LAX"=>rand(0,335),"DFW"=>rand(0,335),"DEN"=>rand(0,335),"JFK"=>rand(0,335),"SFO"=>rand(0,335),"CLT"=>rand(0,335),"LAS"=>rand(0,335),"PHX"=>rand(0,335)),
array(""=>"August", "ATL"=>rand(0,335) , "ORD"=>rand(0,335),"LAX"=>rand(0,335),"DFW"=>rand(0,335),"DEN"=>rand(0,335),"JFK"=>rand(0,335),"SFO"=>rand(0,335),"CLT"=>rand(0,335),"LAS"=>rand(0,335),"PHX"=>rand(0,335)),
array(""=>"September", "ATL"=>rand(0,335) , "ORD"=>rand(0,335),"LAX"=>rand(0,335),"DFW"=>rand(0,335),"DEN"=>rand(0,335),"JFK"=>rand(0,335),"SFO"=>rand(0,335),"CLT"=>rand(0,335),"LAS"=>rand(0,335),"PHX"=>rand(0,335)),
array(""=>"October", "ATL"=>rand(0,335) , "ORD"=>rand(0,335),"LAX"=>rand(0,335),"DFW"=>rand(0,335),"DEN"=>rand(0,335),"JFK"=>rand(0,335),"SFO"=>rand(0,335),"CLT"=>rand(0,335),"LAS"=>rand(0,335),"PHX"=>rand(0,335)),
array(""=>"November", "ATL"=>rand(0,335) , "ORD"=>rand(0,335),"LAX"=>rand(0,335),"DFW"=>rand(0,335),"DEN"=>rand(0,335),"JFK"=>rand(0,335),"SFO"=>rand(0,335),"CLT"=>rand(0,335),"LAS"=>rand(0,335),"PHX"=>rand(0,335)),
array(""=>"December", "ATL"=>rand(0,335) , "ORD"=>rand(0,335),"LAX"=>rand(0,335),"DFW"=>rand(0,335),"DEN"=>rand(0,335),"JFK"=>rand(0,335),"SFO"=>rand(0,335),"CLT"=>rand(0,335),"LAS"=>rand(0,335),"PHX"=>rand(0,335)),
);
?>
<br>
<?php if (count($data) > 0): ?>
<div class="container">
<style type="text/css">
table { width: 50%; }
</style>
<table BORDER=1 BORDERCOLOR=green>
<thead>
<tr bgcolor= GREEN>
<th ><?php echo implode('</th><th>', array_keys(current($data))); ?></th>
</tr>
</thead>
<tbody>
<?php foreach ($data as $row): array_map('htmlentities', $row); ?>
<tr>
<td><?php echo implode('</td><td>', $row); ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<?php endif; ?>