I have a project where a user can add people to a list, that includes name, male or female, and student or leader. Each person is either male or female and a student or leader.
I am trying to get the count for female students, female leaders, male students, and male leaders but not sure how to combine them to do the count. Something like:
$femaleStudent = $female && $student;
$maleStudent = $male && $student;
$femaleLeader = $female && $leader;
$maleLeader = $male && $leader;
Then do something like this:
$total = $femaleStudent + $maleStudent + $femaleLeader + $maleLeader;
How do I combine them so I can count them?
EDIT
$female, $male, $student, and $leader are just getting the count. Here is an example (this is in WordPress):
$female = array_count_values(array_column($participants, 'participant_gender'))['Female'];
The end result I am trying to show is the total number of people and then break it down by female student, female leader, male student, and male leader. My output is basically: Female Students: 8 Male Students = 6, Female Leaders = 2, Male Leaders = 2, Total = 18
EDIT 2
Here is an example of the participants array from a var_dump:
0 =>
array
'participant_first_name' => string 'Steve'
'participant_last_name' => string 'Rogers'
'participant_gender' => string 'Male'
'participant_age' => string '44'
'participant_role' => string 'Leader'
1 =>
array
'participant_first_name' => string 'Lois'
'participant_last_name' => string 'Lane'
'participant_gender' => string 'Female'
'participant_age' => string '15'
'participant_role' => string 'Student'
$femalecontains a number, and$studentcontains a number, how should these numbers (which don't have any more context) be combined by any logic?