Get random element from array in php $arrays = ['one', 'two', 'three', 'four']; echo $arrays[random_int(0, 3)];