I have an associative array with skill ids and its eligible marks/scores. E.g.:
Array
(
[3] => 2 // skill => eligible marks
[63] => 6
[128] => 3
)
And I have a multidimensional array with student ids as first level keys. The second level contains indexed subarrays representing skill ids and marks/scores as 2-element associative arrays.
Array
(
[22] => Array
(
[0] => Array
(
[skill_id] => 3
[gd_score] => 4
)
[1] => Array
(
[skill_id] => 128
[gd_score] => 6
)
)
[23] => Array
(
[0] => Array
(
[skill_id] => 128
[gd_score] => 3
)
)
[24] => Array
(
[0] => Array
(
[skill_id] => 3
[gd_score] => 7
)
[1] => Array
(
[skill_id] => 63
[gd_score] => 8
)
[2] => Array
(
[skill_id] => 128
[gd_score] => 9
)
)
)
I want to filter the students based on the values in the first array.
I want to get all students with:
- skill 3 marks greater than 2 and
- skill 63 marks greater than 6 and
- skill 128 marks greater than 3.
If all criteria are satisfied, return the student id. Because only student 24 meets all requirements, the output should be [24]
-- an array with a single element.
Use the following approach:
The output:
Test link: https://eval.in/private/10a7add53b1378