I have defined the following integer array: $myArray = range(0, 3);
The in_array("1", $myArray);
returns false ?
How to convert the integer $myArray into a string array ?
in_array has 3rd parameter $strict, but it is false by default.
|
|||
|
As others pointed out though, it works as-is |
|||||||||
|
IT 100% works for me
returns
|
|||
|
in_array
doesn't do strict type checking unless you specify it in the third parameter - there's something else going on. – Jimmy Sawczuk Jun 21 '11 at 15:41$myArray = range(0,3); var_dump("1", $myArray);
returnstrue
on my system (PHP5.3.5). It seems, that you are doing something else wrong. – KingCrunch Jun 21 '11 at 15:42var_dump
thein_array
function's result. – Francois Deschenes Jun 21 '11 at 15:42