Get query string only if integer
<p>Trying to get a query string into a variable but only if it's an integer.</p>

<p>Code is probably a bit more complicated than it should be but this is where I'm up to-</p>

<pre><code>  //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;}
</code></pre>

<p>Where am I going wrong?</p>
