search
HomeBackend DevelopmentPHP ProblemOne minute to figure out what are predefined variables in php? What is the $_POST variable?

We have learned so much about PHP. Today we will learn in one minute what are predefined variables in PHP? What is the $_POST variable? , I wonder if you have fully mastered it. If not, then follow this article to continue learning

Related recommendations:What are variable variables in PHP? How to understand mutable variables?

Predefined variables:

The so-called predefined variables actually refer to variables that are predefined in the language tool PHP;

We just "enjoy it and use it"

Overview:

Mainly include:$, _GET,S_ POST,$_ REQUEST, $ _ SERVER, $GLOBALS,

  • ## are all arrays

  • system definition and maintenance - that is, we should not assign values ​​​​to them or To destroy its value, you should only "use its value"

  • has a super-global scope and can be used anywhere.

  • May have different values ​​in different situations

$_POST variable:

Meaning:

It represents all the data submitted when the user submits through the form in post mode (methodu "post") - this is called post data.

<!--
以下表单的数据,点击提交后,会将所有表单数据提交给
8post_ _data.php这个页面(文件),并在该文件中去处理
其实就是指:程序进入该文件中运行。
=-》
<form action="8post data. php" method="post">
数据1: <input type="text" name="data1 />
<br />
数据2: <input type="text" name= "data2" />
<br />
<input type="submit" value="提交" />
</form>

The code is as follows:

$post_data php page and output results:

<?php
//先一个一个获取数据:
$d1 = $_POST[&#39;datal&#39;];
$d2 = $POST[ &#39;data2&#39;];
//然后输出,看看:
echo "d1 = $d1, d2 = $d2";
echo "<hr />";
//再来看看整个$_ POST这个数组数据!
print_r($_POST);
?>

The running results are as follows:

One minute to figure out what are predefined variables in php? What is the $_POST variable?

ise (variable):

Determine whether the variable exists or whether the variable is empty (nul); if it exists, it is true, otherwise It is false

empty (variable): Determine whether the "inner core" of the variable is empty (not null, but empty). Basically, it is some rigid rules. The following data are all "empty" ": ."" "0", false, null, array0The empty array is also empty

If the content of a variable is empty, the result returned by empty(0 is true, otherwise it is false;

Recommended learning: "

PHP Video Tutorial"

The above is the detailed content of One minute to figure out what are predefined variables in php? What is the $_POST variable?. 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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor