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

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

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-13 11:59:36
Original
1230 people have browsed it

怎样得到$_SERVER['QUERY_STRING']等号前的内容
例如new?forum_id=PHP
怎样用$_SERVER['QUERY_STRING']得到forum_id
各位大大指点一下吧,谢谢
------解决方案--------------------

$s = $_SERVER['QUERY_STRING'];<br /><br />//用 parse_str 解析<br />parse_str($s, $a);<br />echo key($a);<br /><br />//用 strtok 解析<br />echo strtok($s, '=');<br />
Copy after login

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template