Im storing age values inside an array using array push,
foreach($arrayagevalues as $value){
$arrayage21to30 = array();
$arrayage31to40 = array();
if($value['Age'] >= 21 && $value['Age'] <= 30)
{
array_push($arrayage21to30, $value['Age']);
}
if($value['Age'] >= 31 && $value['Age'] <= 40)
{
array_push($arrayage31to40, $value['Age']);
}
}
at the end I want to count the total values stored inside my array in $arrayage21to30 ans $arrayage31to40. I used count($arrayage21to30); but it doesnt return the total number of array values inside my array.
Is there any way on how I can count values of an array or the approach of storing values inside my array is wrong?
foreach loop.total values, do you meansum, if yes, see the last part of my answer, I have updated it.