最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

使用$

运维笔记admin28浏览0评论

使用$

使用$

使用$ _GET在Querystring中只读参数名称(Read only parameter name in Querystring with $_GET)

我怎样才能从PHP中的查询字符串读取参数名称? 例如在这两个方面:

www.example.com/index.php?a='1'www.example.com/index.php?a

想要的输出是:

a

How can I read only the parameter name from a querystring in PHP? For example in both of these:

www.example.com/index.php?a='1'www.example.com/index.php?a

the wanted output is:

a 最满意答案

您可以使用全局$ _GET数组的array_keys :

$keys = array_keys($_GET);echo $keys[0]; // echos a

You can use the array_keys of the global $_GET array:

$keys = array_keys($_GET);echo $keys[0]; // echos a

发布评论

评论列表(0)

  1. 暂无评论