Displaying Random Quotes
Jun 7, 2008
Displaying random quotes is the easiest thing to do with PHP. But in case you don't know how, here it is:
<?php function random_quote() { $quotes = array ( "quote 1", "quote 2", "quote 3", "quote 4", "quote 5" ); $rval = rand(0, count($quotes) - 1); print $quotes[$rval]; } /* select random quote and print */ random_quote(); ?>
Keywords: random quotes, tips of the day, randomize string, php
Share:
Save to del.icio.us
Digg this!

Add your comment