New answers tagged

3 votes

Array_search ignoring the first element

In PHP, the number 0 is interpreted as false-ish. Your if-statement asks for a true-ish condition like this: If the result of the array_search function is interpreted as true-ish, THEN do the stuff ...
user avatar

Top 50 recent answers are included