Check query string (PHP)

后端 未结 5 1956
闹比i
闹比i 2021-01-14 21:21

I use a query string, for example test.php?var=1.

How can I check if a user types anything after that, like another string...

I try to redirect

5条回答
  •  -上瘾入骨i
    2021-01-14 22:02

    I'm not sure I fully understand what you want, but if you're not interested in the positioning of the parameters this should work:

    if ( isset($_GET['var']) && count($_GET) > 1 ) {
        //do something if var and another parameter is given
    }
    

提交回复
热议问题