Home >Backend Development >PHP Tutorial >PHP4 User Manual: Data Types-arrays_PHP Tutorial

PHP4 User Manual: Data Types-arrays_PHP Tutorial

WBOY
WBOYOriginal
2016-07-13 17:22:18871browse

Arrays
An array in PHP is actually an ordered map. A mapping maps values ​​to keywords. This type is optimized over individual methods and you can use it as a real array or a list (vector), hashtable (an implementation of a map), dictionary, aggregate, stack, queue and more. Since you may have another PHP-array as a value, you can also emulate a tree structure very easily.
Explanation of this structure is beyond the scope of this manual, but you will find a minimal example of this structure. For more information about this structure, please consult other literature. Syntax Use Website Construction Server Script Class PHPPHP User Manual fancyfunction.array.html>array() to specify an array
An array can be constructed by array(). It consists of a pair of key => value and a series of numbers separated by commas.
A key is any non-negative integer or a string. If a is expressed by a standard non-negative integer, it will be interpreted as such (i.e. 8 will be interpreted as 8, 08 will be interpreted as 08).


A value can be arbitrary.
Ignore keys. If you omit a key, the new key will be with the largest integer index plus one. If the integer index does not exist either, this key will be 0. If you have assigned a value to a key, this will be overwritten.
array( [key =

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/532353.htmlTechArticleArrays An array in PHP is actually an ordered mapping. A mapping maps values ​​to keywords. This type is optimized on a single method, which you can use as a real...
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