This article mainly introduces the PHP definition array and uses the example (PHP array definition method), needs the friend to be possible to refer to under
This is a php example of an array, a brief description of the basic use of the array, the example added the annotation code as follows: <?php//define an array of strings $fruit = Array ("Apple", "orange"); The value of the reference array is $fruit [0];//represents the value of the Apple $fruit [1];//represents orange//note that the index of the array is from 0, and people who have studied C and Java know it. Defines an array of numeric values $number = Array (1,2,3,4,5);//reference array value IBID.//To define a conforming array $mix = Array (1, "Example", "Hello", 2.5);//reference array value IBID.//Also available Defines an array $ex by key value = Array ("A" => "fruit", "B" => "Car"); You can refer to the $ex ["a"];//the corresponding value is the fruit $ex ["B"];//corresponds to the value is the car//can also create such a key-value-compliant array?>