PHP has two types of arrays, indexed arrays and associative arrays, which are declared in a similar manner, mainly in the following three ways of declaring:
How to declare:
Array (); Can declare any array, see the following example
1,2,3); print_r($temp);//这是打印数组的方法/** 输出的结果,Array90 **/
Note the point:
1. Null to do the data key will be turned into an empty string;
2. When a new value is added, the array is labeled as the current maximum subscript plus 1, if the subscript maximum is negative, the index is 0 when an element with an unspecified index is added;
3.
$_POST:接收表单以POST发送的数据$_GET:接收表单以GET方式发送的数据$_REQUEST:$_GET+$_POST+$_COOKIE$_FILES:HTTP文件上传变量$_SERVER:服务器与执行环境变量$_ENV:环境变量$_SESSION:会话变量$_COOKIE:http cookie$_GLOBALE:预定义变量的总集合$php_errormsg:前一个错误信息(只在错误发生的作用域内可用,需要开启php.ini里track_error配置项)
Copyright NOTICE: This article is the original article, reprint need to indicate the source, the article view only represents the view at that time, there must be insufficient, welcome to make bricks remind, thank you very much!
The above describes the PHP learning Note _5_ array and predefined variables (not finished), including the aspects of the content, I hope that the PHP tutorial interested in a friend helpful.