choose a random from array in php code example Example: choose a random word from an array php $items = array(1, 2, 3, 4, 5); echo $items[array_rand($items)];