$value){ if ($numbers[$key] <= $money) { $ans++; } } echo $ans * 30;