I've been playing with this for way too long. So I thought I would ask here.
I'm trying to check if a array element value can be found as a data element in a reference array. I'm using this:
if (!in_array($arg, $arrayname, true)) {
this would occur if the $arg value is NOT found in the array
}
What I'm experiencing is even if the searched arrayname contains a substring of the $argument is returning true.
Example:
If I search for abc and the array element contains abcdef it would return found.
What do I need to do to assure the element I'm testing for is the exact same match as the argument value?
example:
If the argument was abc then the array element value must be exactly abc
Any hint, suggestions greatly appreciated.
Thanks
I'm trying to check if a array element value can be found as a data element in a reference array. I'm using this:
if (!in_array($arg, $arrayname, true)) {
this would occur if the $arg value is NOT found in the array
}
What I'm experiencing is even if the searched arrayname contains a substring of the $argument is returning true.
Example:
If I search for abc and the array element contains abcdef it would return found.
What do I need to do to assure the element I'm testing for is the exact same match as the argument value?
example:
If the argument was abc then the array element value must be exactly abc
Any hint, suggestions greatly appreciated.
Thanks