My site uses PHP to check if the value submitted by the user using the "get" method is a certain integer. The code is something along the lines of
if ($_GET['input']==2) { ... }
However I have recently discovered that if the user inputs something like 2a, 2two or even 2omdodonsos, it is still perceived as the value 2 by PHP. However if the user inputs 23eee, 23twenty or 23ofnofnonf, it is not perceived as 2. Why does this happen? Will using this code:
if ($_GET['input']="2") { ... }
solve the problem?