phpでmt_rand()を使って乱数を生成するサンプル
PHPコード:
$rand = mt_rand(0,1);
if( $rand==0 )
{
$array = array(36,35,16,29,30);
}
elseif( $rand==1 )
{
$array = array(32,42,37,400,444);
}
foreach( $array as $v => $vv )
{
echo “$vvn";
}
Coding Changes the World
PHPコード:
$rand = mt_rand(0,1);
if( $rand==0 )
{
$array = array(36,35,16,29,30);
}
elseif( $rand==1 )
{
$array = array(32,42,37,400,444);
}
foreach( $array as $v => $vv )
{
echo “$vvn";
}