How to determine whether get storage exists in php

藏色散人
Release: 2023-03-11 18:12:02
Original
2123 people have browsed it

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"];//存在
        }
    }
Copy after login

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!

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 Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template