I have the following structure:
$foo_array = array(
[0] => object(foo) {
'id' => 1
}
[1] => object(foo) {
'id' => 2
}
)
And I want to check if int (1) exists in this id attribute of the array. How can i do this?
I was thinking of something like in_array(1, $foo_array), but of course, this does not work.
source
share