Trying to get a query string into a variable but only if it's an integer.
Code is probably a bit more complicated than it should be but this is where I'm up to-
//get page number. default is 1. check is not empty and is a number
if (empty($_GET['pag'])) {$page = 1;}
else if (is_int($_GET['pag'])){$page = $_GET['pag'];}
else {$page = 1;}
Where am I going wrong?