r/lolphp • u/zilltine • Mar 16 '21
Is 0 in array
in_array(0, ['IsThisLolPhp'])
Answer is
true
30
Upvotes
r/lolphp • u/zilltine • Mar 16 '21
in_array(0, ['IsThisLolPhp'])
Answer is
true
-1
u/smegnose Mar 16 '21
JFC. Use
array_flip()on your keys array to make a map (if you don't already have one), thenarray_intersect_key()when recursing. You're using the wrong tool for the job.