<?php
$array = array(5,5,10,20,30,40,50,64,7,10);
$a = array_fill(0, 9, 0);
foreach ($array as $number) 
  $a[(int)($number/10)]++;
print_r($a);