PHP中的数组实际上是一个有序的映射,映射是一种连接价值的钥匙。这种类型在很多方面得到了优化,所以它可以被看作是一个真正的数组或列表(矢量),哈希表(映射实现),字典,集合,栈,队列和更多的可能性。数组元素的值也可以是另一个数组,树结构和多维数组也可以。 可以使用数组()创建数组语言结构,它接受任意数量的逗号分隔键(键)=值(value)。 Key can be integer or string.If key is a standard representation of a integer, it is interpreted as an integer (for example, 8 will be interpreted as 8, and 08 will be interpreted as 08).Floating point key is rounded up to integer.In PHP, the index array is the same as an associative array, and they can both contain the subscript of the integer and string. 该值可以是任意PHP类型。 如果在不指定键的情况下给出值,则取最大整数索引值,该键将添加一个新值。如果指定的键具有值,则该值将被覆盖。 使用真作为键将使整数1成为键。使用false作为键将使整数0成为键。NULL作为键名称的使用将等同于空字符串的使用。使用空字符串作为键将创建(或覆盖)以空字符串作为键值,这与使用空括号不一样。 数组和对象不能用作键(键)。这将导致警告:非法偏移类型。