مثال:-

$rand = rand(5,644);
echo $rand;
----control---
if ( $rand == 541 ) {
}
elseif ($rand == 644) {
}

اتمني ان تكون وضحت الفكره!