0){...}" statement to determine whether the parameter passed by get exists. Can."/> 0){...}" statement to determine whether the parameter passed by get exists. Can.">

Home  >  Article  >  Backend Development  >  How to determine whether get storage exists in php

How to determine whether get storage exists in php

藏色散人
藏色散人Original
2021-07-22 09:15:032125browse

php method to determine whether get exists: first create a PHP sample file; then determine get through the "if(is_array($_GET)&&count($_GET)>0){...}" statement Just check whether the parameter passed by value exists.

How to determine whether get storage exists in php

The operating environment of this article: windows7 system, PHP7.1 version, DELL G3 computer

How does php determine whether the get store exists?

php Determine whether the parameter passed by get value exists

if(is_array($_GET)&&count($_GET)>0)//先判断是否通过get传值了
    {
        if(isset($_GET["id"]))//是否存在"id"的参数
        {
            $id=$_GET["id"];//存在
        }
    }

In PHP, the predefined $_GET variable is used to collect values ​​from the form with method="get" .

$_GET Variable

The predefined $_GET variable is used to collect values ​​from the form with method="get".

The information sent from a form with the GET method is visible to anyone (will be displayed in the browser's address bar), and there is a limit on the amount of information sent.

Recommended learning: "PHP Video Tutorial"

The above is the detailed content of How to determine whether get storage exists in php. For more information, please follow other related articles on the PHP Chinese website!

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