Rand feature creating a string for a variable[solved]
Posted: Fri Aug 17, 2007 6:16 pm
Hello,
Im quite new to using rand features in php. Im trying to figure out how to do something like this:
Randomly choose one of these 5 lines:
$QuoteResult = 'Result: You search the train station from top to bottom and find $1!'
$QuoteResult = 'Result: You search the train station from top to bottom and find $3!'
$QuoteResult = 'Result: You search the train station from top to bottom and find $5!'
$QuoteResult = 'Result: You search the train station from top to bottom and find $8!'
$QuoteResult = 'Result: You search the train station from top to bottom and find $10!'
Reason i do it like this is cos then i just echo $QuoteResult ... seems to be easier but im unsure how to structure it.
Im quite new to using rand features in php. Im trying to figure out how to do something like this:
Randomly choose one of these 5 lines:
$QuoteResult = 'Result: You search the train station from top to bottom and find $1!'
$QuoteResult = 'Result: You search the train station from top to bottom and find $3!'
$QuoteResult = 'Result: You search the train station from top to bottom and find $5!'
$QuoteResult = 'Result: You search the train station from top to bottom and find $8!'
$QuoteResult = 'Result: You search the train station from top to bottom and find $10!'
Reason i do it like this is cos then i just echo $QuoteResult ... seems to be easier but im unsure how to structure it.