Posted 24 May 2006 - 07:48 AM
What i have tried but just cant figure it out though (i need for the script im making) is a randomization. Basiclly i want is to have a randomized word to output on the page onced a user has filled in some info and pressed the submit button.
Now i know how to do it all except for how to make a random word, i would like to add a fair amount of words in it.
So would anyone either post, or explain how to make a random word appear.
Posted 24 May 2006 - 02:04 PM
$words = array("zero","one","two","three","four","five","six","seven","eight","nine"); echo $words[rand(0,(count($words)-1))];
store some words on an array, then just generate a random index
from zero to max index of array ( (count($words)-1)) )
Posted 24 May 2006 - 08:33 PM
That is very close how i had been doing it, i knew an array needed to be used to store the words but i couldent figure out that second part.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users