PHP scripts and programs for Beginner to Master

php programs, php ready to use scripts & functions, css tutorials, html, javascripts, ajax examples for Beginner to Master

This is very simple and useful php script if you want to display some random quotes each time a page is visited or refreshed.

$quote = array(
1 => "Random Quote 1",
2 => "This is sample quote 2",
3 => "check",
4 => "it really works",
5 => "wooooooooooooooooooooow",
6 => "I am on twitter"
$randnum = rand(1,6);
echo "
Random Quote - $quote[$randnum]

This is a very basic version of the script.

Soon you can see the modified version of this script with database support to show random quotes from the database.

I'm reading: Show random quotes on page refresh with phpTweet this!


Post a Comment