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,
$_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['datal']; $d2 = $POST[ 'data2']; //然后输出,看看: echo "d1 = $d1, d2 = $d2"; echo "<hr />"; //再来看看整个$_ POST这个数组数据! print_r($_POST); ?>
ise (variable):
Determine whether the variable exists or whether the variable is empty (nul); if it exists, it is true, otherwise It is falseempty (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 emptyIf 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!