Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/237.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/c/58.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
php-什么';当运算符[]为空时,它的用途是什么_Php - Fatal编程技术网

php-什么';当运算符[]为空时,它的用途是什么

php-什么';当运算符[]为空时,它的用途是什么,php,Php,有人能解释一下下面表达式中的[[$field][]运算符的用途吗 // Field rules protected $_rules = array(); // Store the rule and params for this rule $this->_rules[$field][] = array($rule, $params); 它将为该数组创建一个新的(编号的)索引 基本上就是这样。(除了array\u push不会返回新的数组对象)它将为该数组创建一个新的(编号的)索引 基本

有人能解释一下下面表达式中的
[[$field][]
运算符的用途吗

// Field rules
protected $_rules = array();

// Store the rule and params for this rule
$this->_rules[$field][] = array($rule, $params);
它将为该数组创建一个新的(编号的)索引

基本上就是这样。(除了
array\u push
不会返回新的数组对象)

它将为该数组创建一个新的(编号的)索引


基本上就是这样。(除了
array\u push
不会返回新的数组对象)

创建一个新的整数索引。它将一个新的数值索引元素附加到数组的末尾。创建一个新的整数索引。它将一个新的数值索引元素附加到数组的末尾。
这基本上就是array\u push()的功能。
除了
[]
将创建一个新数组,而
数组推送()
不会
这基本上就是数组推送()所做的。
除了
[]
将创建一个新数组,而
数组推送()
不会