I’m trying to check if the of an id is available inside this array of std objects, i do not want to loop through the array as it will not display the correct information. My code is as follows:
Array( [0] => stdClass Object ( [name] => My Name [id] => 1234567890 ) [1] => stdClass Object ( [name] => Other User Name [id] => 987654321 ) )
I tried using in_array method and it doesnt find the id key and value.
Thank you
D~~
You’ll need to loop the array to perform a check on an attribute of the objects inside the array. Write a function that will return your desired value like (pseudo-code):