Calculate the value in the position and add up?

I use the database interaction between curl and my counterpart
to give me array
where a bit value called available, is a Boolean value
the counterpart gives me 10 years
in which 4 available is ture
how can I figure out "4" at this point?

foreach ($anget_my_people_data->{"users"} as $key) {

    echo $key->{"available"};
}
Mar.12,2021

like this?

$i = 0;
foreach ($anget_my_people_data->{'users'} as $key) {
    if ( $key->{'available'} ===TRUE){
        $iPP;
    }
}
return $i;
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b30add-4d3d1.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b30add-4d3d1.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?