I wish to count the values in the array Course that have the inner value Completed=>true. There are two values when I do a standard count. I have tried is_array and array_filter
count($employee['Course']
output: 2
Course(array)
0(array)
id:1
name:Handling
CoursesEmployee(array)
id:1
employee_id:1
course_id:1
completed(true)
1(array)
id:3
name:Induction
CoursesEmployee(array)
id:2
employee_id:1
course_id:3
completed(false)
array_filter()and what was the result?array_filter()takes an optional argument to specify a function that gets called for each element in your array. I'd suggest you start with that.