Or is there a ready function there?
Put the numbers in an array and use:
$selectrand = array_rand($arrayname, 5);
Try this:
$randomnumber = (rand()%$num);