0
0 Comments

If i search for numbers, in_array will
convert any strings in array to numbers, dropping any
letters/characters, forcing a numbers-to-numbers comparison. So if i
search for 1234, it will say that ‘1234abcd’ is a match.  Example

<?php
$test_array = array('test', '1234some');
if (in_array(1234, $test_array)) {
    echo '1234 is a good!';
}
?>

Changed status to publish
Add a Comment