Home > php教程 > php手册 > body text

PHP判断是否有Get参数的方法

WBOY
Release: 2016-06-06 20:22:55
Original
1779 people have browsed it

这篇文章主要介绍了PHP如何判断是否有Get参数,方法很简单,一个函数就可以搞定,需要的朋友可以参考下

可采用如下方式判断

复制代码 代码如下:


if(is_array($_GET)&&count($_GET)>0)//判断是否有Get参数
{
if(isset($_GET["para"]))//判断所需要的参数是否存在,isset用来检测变量是否设置,返回true or false
{
$para=$_GET["para"];//存在
}
}

Related labels:
php
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 Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template