PHP Fetch an element from the array randomly – PHP May 11, 2011 Pramod T P Leave a comment <?php $testArray = array("value1", "value2", "value3", "value4"); $testRand = array_rand($testArray, 2); echo $testArray[$testRand[0]]; ?>