This article mainly introduces the php definition array and example (php array definition method). For more information, see
This is an example of the php array. It briefly describes the basic use of the array. The annotation code in the example is as follows: <? Php // define a string array $ fruit = array (\ "apple \", \ "orange \"); // reference the array value $ fruit [0]; // indicates the value of apple $ fruit [1]; // indicates the value of orange. // It is worth noting that the index of the array starts from 0, anyone who has studied c and java knows this. // Define a numeric array $ number = array (1, 2, 3, 4, 5 ); // The value of the referenced array is the same as the preceding one. // define a conforming array $ mix = array (1, \ "example \", \ "hello \", 2.5 ); // The value of the referenced array is the same as the preceding one. // You can also use the key-value method to define the array $ ex = array (\ "a \" => \ "fruit \", \ "B \" => \ "Car \"); // You can reference $ ex [\ "a \"] like this; // The corresponding value is the fruit $ ex [\ "B \"]; // the corresponding value is the car // You can also create such an array of key-value conformity types?>