655   PHP

一,解释:

// 从$low到$high,按照$step间隔,一个个显示出来
range($low,$high,$step);

二,实例

echo "\n";
$az = range('a','z',1);
foreach($az as $val){
	echo $val.' ';
}

echo "\n";
$num = range(1,20,2);
foreach($num as $val){
	echo $val,' ';
}

输出


a b c d e f g h i j k l m n o p q r s t u v w x y z
1 3 5 7 9 11 13 15 17 19



Leave a Reply

Your email address will not be published. Required fields are marked *