I have the following array.
Array
(
[0] => Array
(
[product] => p1
[item] => q1
[date] => d1
[status] => N
)
[1] => Array
(
[product] => p2
[item] => q2
[date] => d2
[status] => Y
)
[2] => Array
(
[product] => p1
[item] => q3
[date] => d3
[status] => N
)
)
From this array, I want date from above with the given product and value.
For Example, I have product = p2 and item = q2 as a string. Now from this array, I want a date from this array which has product = p2 and item = q2.
So I need output from the above example is: d2
I tried array_column and array_search but can't find value from product and item both.
Please help me out with this in PHP.
You can iterate over your products and check required criteria with if statement.