<?php
/*This small script uses the rand() function in PHP to randomly generate desired content. This script is simply an example of how it may be used to generate content. In this script, a certain quote will be displayed depending on the number that is returned by the rand() function.*/
//rand(1, 3) means that the random number will range from 1 to 3.
$number =
rand(1,
3);
//These if/else if statements return strings according to the number that was generated.
if($number==
1) {
echo "This is the string that will be displayed when the random number is 1!";
}
else if($number==
2) {
echo "Since the number was 2, this string was returned!";
}
else if($number==
3) {
echo "The number this time was 3!";
}
?>
This may seem somewhat basic, but it may be used to do more advanced things such as displaying banners on sites, playing random music clips, or any other use that you could think of. Feel free to ask any questions that you might have.