How to check whether a variable in $_GET Array is an integer?

前端 未结 9 1599
北恋
北恋 2020-12-10 20:46

I have a page like so:

http://sitename/gallery.php?page=2

It has pagination links at the bottom by which we can br

9条回答
  •  旧时难觅i
    2020-12-10 21:28

    You can also check with

    isNAN($_GET['something']);//is_numeric($_GET['something'])
    

    it returns a boolean value(true,flase)....if its true then it is not an integer,if false its an integer.

提交回复
热议问题