This is my array:
$int = array (
1 => "Items1",
2 => "Items2",
3 => "Items3",
4 => "Items4"
);
And when I do:
var_dump(in_array( 4 , $int ));
It is returning: bool (false).
I’ve read that is caused by the object given , instead of array, but aren’t there any solution for that?
in_array: Checks if a value exists in an array.
You’ll want array_key_exists().