Home  >  Article  >  Backend Development  >  One of php array learning

One of php array learning

巴扎黑
巴扎黑Original
2016-11-22 09:59:191289browse

php array learning
Array: a collection of keywords and values. The same php array can store values ​​of multiple different data types. The array subscript starts from zero
Several ways to create an array:
(1)

Php code

$arr[0]=1;//Array element

$arr[1]=2.8;

......


(2)

Php code

$arr = array(1, 2.8,"str",....);


(3)

Php code

//You can specify the subscript of the array element yourself

$arr = array("dizhi"=>"beijing ",..)//Use array("key"=>"value")


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