I have an array and when using in_array to check if object exists it always returns false.
As an example, here is the array:
array:1 [
0 => "name1, name2, name3"
]
and this is how I check if index exists
if(!in_array('name1', $array)) { return FALSE; } else { return TRUE;}
Name1 exists in array I have however I think I'm missing something small here.
Not sure what it could be or even if this function is the right function to use to check? Expected result is to be true as object exists.
Thanks