双色球

简单的程序:

<?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;

 

你可能感兴趣的:(双色球)