A form on my configuration page reads a channel number from an input box and compares it with if (channel == 0). The branch is taken not only for "0" but also when the box is left empty, which disables the wrong output. With === the branch is never taken at all, even when I type 0.
I know the advice is to always use ===, but I would like to understand what == actually does, why an empty string equals zero, and how to compare user input with numbers correctly.




