Home >Backend Development >PHP Tutorial >怎样得到$_SERVER['QUERY_STRING']等号前的内容

怎样得到$_SERVER['QUERY_STRING']等号前的内容

WBOY
WBOYOriginal
2016-06-23 13:55:28822browse

例如new?forum_id=PHP
怎样用$_SERVER['QUERY_STRING']得到forum_id
各位大大指点一下吧,谢谢


回复讨论(解决方案)

$s = $_SERVER['QUERY_STRING'];//用 parse_str 解析parse_str($s, $a);echo key($a);//用 strtok 解析echo strtok($s, '=');

谢谢大侠.   ~~~~~~~`

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn