1.建立升序数组:range(); $numarr1 = range(1,4); //(1,2,3,4) $numarr2 = range(1,10,2); //(1,3,5,7,9) $letter = range('a','z'); //('a','b','c'......'z') 2.使用循环访问数组: $fruit[3] = ('apple', 'banana', 'pear'); for ($i = 0;$i<3;$i++) echo $fruit[$i].' '; //等价于下面代码