双色球

简单的程序:

<?php
//双色球实例
$balls = range(1,33);
$redBallsIndex = array_rand($balls, 6);
$blueBall = mt_rand(1,16);

echo 'Red ball:';

foreach ($redBallsIndex as $index) {
    echo $balls[$index] . ' ';
}

echo '<br />Red ball:' . $blueBall;

 

posted @ 2013-12-04 14:14  幻星宇  阅读(149)  评论(0编辑  收藏  举报