JonnySnip3r Posted August 15, 2010 Share Posted August 15, 2010 Hey guys does anyone know how i would go about generating a random word from an array? For example: $words = array("[apple]","[banana]","[kiwi]"); how would i have php choose one of these words and then spit it out? Thanks!!! Link to comment https://forums.phpfreaks.com/topic/210777-php-random-word-from-array/ Share on other sites More sharing options...
kenrbnsn Posted August 15, 2010 Share Posted August 15, 2010 Look at the shuffle function or the array_rand function. Ken Link to comment https://forums.phpfreaks.com/topic/210777-php-random-word-from-array/#findComment-1099514 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.