dongruoqiong9017 2011-12-12 03:56
浏览 361
已采纳

获取URL查询字符串参数

What is the "less code needed" way to get parameters from a URL query string which is formatted like the following?

www.mysite.com/category/subcategory?myqueryhash

Output should be: myqueryhash

I am aware of this approach:

www.mysite.com/category/subcategory?q=myquery

<?php
   echo $_GET['q'];  //Output: myquery
?>
  • 写回答

10条回答 默认 最新

  • doubeng3216 2011-12-12 03:57
    关注

    $_SERVER['QUERY_STRING'] contains the data that you are looking for.


    DOCUMENTATION

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(9条)

报告相同问题?