brown2005 Posted March 5, 2007 Share Posted March 5, 2007 if I have cabbage apples what i want is to select one at random and display, how do I do this please, I think I should use an array, but I have totally forgot how to do it, thanks richard Link to comment https://forums.phpfreaks.com/topic/41297-solved-random/ Share on other sites More sharing options...
trq Posted March 5, 2007 Share Posted March 5, 2007 <?php $arr = array('cabbage','apples'); $rand = rand(0,1); echo $arr[$rand]; ?> Link to comment https://forums.phpfreaks.com/topic/41297-solved-random/#findComment-200110 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.