I have an array of 0845 numbers that is being searched via in_array for a specific numbers. For some reason, omitting the leading zero from the needle returns a false positive:
$numbers = array(
'08451234567',
'08452345678',
'08453456789',
'08454567890',
...
);
var_dump(in_array('08451234567', $numbers)); //(Boolean) TRUE - Right
var_dump(in_array('8451234567', $numbers)); //(Boolean) TRUE - Wrong
I have tried casting the values in the array as strings, but that did not work.
What is going on, and how do I fix it?
[edit]
Added quote around my needles