Is there a clean elegant way to check if an array object value that has specific value "positionID = string(29)" and if its "Action" starts with for eg "(string) 1" and ends with "(string) 0".
The unlooped array looks similar to this
array (
[0] => Object1 {
['PositionID'] => (string) 29
['Action'] => (string) 1
}
[1] => Object22 {
['PositionID'] => (string) 30
['Action'] => (string) 0
}
[2] => Object23 {
['PositionID'] => (string) 29
['Action'] => (string) 1
}
[3] => Object5 {
['PositionID'] => (string) 31
['Action'] => (string) 0
}
[2] => Object23 {
['PositionID'] => (string) 29
['Action'] => (string) 0
}
);
I would like to find out within that array that the last "Action" occurence of "positionID= 29" is 0 or something else. At the moment I am grouping the positionId and storing them into a third array and looping it which feels like a dirty solution to me.