I have a page like so:
http://sitename/gallery.php?page=2
It has pagination links at the bottom by which we can br
Using is_int
won't help, probably. All incoming parameters (including $_GET and $_POST) are parsed as strings by PHP. The is_int
function checks the datatype, not the value. ctype_digit
checks for only digits though:
if(isset($_GET['page']) && ctype_digit($_GET['page']){
$page = (int)$_GET['page'];
echo "Page Number: ".$page;
}