vendredi 15 septembre 2017

php rand function i want to skip 1 int and have a random number between 4 integers

I want to do something like this
$ticket = rand(1,44 & 46,89);

I have tried

$ticket = rand(44,46);

if($ticket === 45){

}elseif($ticket === 90){

}else{
    rand(1,90);
}

Still sitting with the problem that 45 and 90 comes forth

I want random numbers but want to skip the int 45




Aucun commentaire:

Enregistrer un commentaire