Here is the $haystack
array:
Array
(
[438] => stdClass Object
(
[w] => 438
[x] => 0
[y] => 438
[z] => 23
)
[4960] => stdClass Object
(
[w] => 4960
[x] => 0
[y] => 4960
[z] => 37
)
)
Why does this not work? How can I tell $needle
is in $haystack
. I am getting this error stdClass could not be converted to int
.
$needle = 438;
if(in_array($needle,$haystack)){
echo "yes";
}else{
echo "no";
}