I am looking for away to check if a string exists as an array value in an array is that possible and how would I do it with PHP?
Say we have this array:
'foo',
2 => 'bar',
3 => 'baz',
);
?>
If you want to check if the element 'foo' is in the array, you would do this
If you want to get the array index of 'foo', you would do this:
Also, a simple rule for the order of the arguments in these functions is: "needle, then haystack"; what you're looking for should be first, and what you're looking in second.