I want to know how to validate a code that must be integer through $ _GET?
For example, I have a GET called id and it theoretically always must be integer (1,2,3,4,5 ...). Is the way I'm validating correct?
$id = filter_input(INPUT_GET, 'id', FILTER_VALIDATE_INT) ? $_GET['id'] : 0;