James James - 4 years ago 210
PHP Question

Get random item from array

$items = Array(523,3452,334,31,...5346);


Each item of this array is some number.

How do I get random item from
$items
?

Answer Source
echo $items[array_rand($items)];

array_rand()

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download