Randomize Script

A randomizing script can be very useful for link rotations, random quotes, or alternating catchphrases. To use the script, create an array like the following:

$random_text = array("Replace with text or image number 1.",
"Replace with text or image number 2.",
"Replace with text or image number 3.",
"Replace with text or image number 4.",
"Replace with text or image number 5." );

You can edit, remove, and add lines to the script. After you've set up your array, add the function that will randomize your array.

srand(time());
$sizeof = count($random_text);
$random = (rand()%$sizeof);

And finally, use this code to display your randomization.

print("$random_text[$random]");

Put it all together, and this is what you get:



« Back - [Refresh] - Forward »

Your Ad Here
EXITS
Smiley Helper Topsite




AFFILIATES
TWITTER
Layout and content © Jenny unless otherwise stated. Layout banner base © [xxx].