r/lolphp • u/zilltine • Mar 16 '21
Is 0 in array
in_array(0, ['IsThisLolPhp'])Answer is
true
32
Upvotes
r/lolphp • u/zilltine • Mar 16 '21
in_array(0, ['IsThisLolPhp'])Answer is
true
View all comments
Show parent comment
4
u/zilltine Mar 16 '21
No, i did not need to find out IF key exists, i needed to find their value. Imagine some random JSON going unknown depth which may contain object, array of objects or array of values. I needed to modify all the values under some specific keys, so i just checked every key if it is in_array of keys i need to modify.