You can use subscript variables in your program, which means that the whole array of these variables is the same as the data type of each variable. when each element in an array has only one subscript, the array is called a one-dimensional array.
A one-dimensional array is a single array of structures arranged in a simple sort structure, consisting of numbers. A one-dimensional array is the most basic array in a computer program. Two-dimensional and multidimensional arrays can be thought of as multiple overlays of one-dimensional arrays.
A simple example of a PHP loop one-dimensional array, first the string according to certain rules to convert into an array, and then traverse the output, is actually a very simple method, because a recently done a two-dimensional array structure diagram is a headache, so womb can't remember how to traverse the output. The simple example code is as follows:
foreach Traversal array
<?php /* * Array Traversal * /$language = Array ("French", ' German ', ' Russian ', ' Chinese ', ' Hindi ', ' Quechu '); foreach ($language as $key = + $value) { echo $key. ' = '. $value. ' <br/> '; } ?>
Traversal of associative arrays
<?php /* * Associative array traversal * /$userList = Array (' UserName ' = ' Lilia ', ' Gender ' = ' female ', ' age ' = > ' Up ', ' School ' = ' Peking University '); foreach ($userList as $key = + $value) { echo $key. ' = '. $value. ' <br/> '; } ?>