function arrayrandom($arr, $num = 1) {

shuffle($arr);

$rm = array();

for ($i = 0; $i < $num; $i++) {

$rm[] = $arr[$i];

}

return $num == 1 ? $r[0] : $rm;

}

Your Answer
Sign In
Enter email and password to comment or answer
Not the answer you are looking for? Browse other questions tagged or ask your own question.