Author: Corey

PHP – ‘anything’ in_array 0 is true

To my surprise an any array with value of 0 will cause the in_array function to be true. This is because PHP converts the string being compared to a number. ‘something’ == 0 is true because ‘something’ gets converted to

Tagged with:
Top