php get variables as key with no value assigned

前端 未结 5 1539
执笔经年
执笔经年 2021-01-12 11:45

If I enter the following into the browser:

   http://domain.com/script.php?1234

And script.php has the following script:

           


        
5条回答
  •  暖寄归人
    2021-01-12 11:53

    This is correct. The variable is called 1234 and it has no value. That means

    GET['1234'] == '';
    

    You could as well write http://example.com?1234=10 Then the result would be

    GET['1234'] == '10';
    

提交回复
热议问题