php get variables as key with no value assigned

前端 未结 5 1589
执笔经年
执笔经年 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 12:05

    You could as well do

    echo $_SERVER['QUERY_STRING']
    

    As for creating friendly URLs, there are better ways to do it.

    See e.g.: $_GET and URL Rewriting for PHP

提交回复
热议问题