range函数的应用!
<?php
/**
* QQ:5871029 Email:hel8@vip.qq.com
* @copyright Horleun (c)2010
* @author Horleun <Horleun@foxmail.com>
*/
foreach(range(0,10) as $num)
{
echo $num ;
}
echo”<br/>”;foreach(range(0,100,10) as $num1)
{
echo $num1 ;
}
echo”<br/>”;foreach(range(‘g’,’a’) as $var)
{
echo $var ;
}
echo”<br/>”;
?>
range函数的应用~!
上例结果:
012345678910
0102030405060708090100
gfedcba