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

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

WBOY
Release: 2016-06-23 13:55:28
Original
819 people have browsed it

例如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, '=');
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