Displays a random quote on a web page. Quotes are picked from a list that you define.
Create a page and call it ( random_quote.php ) or anything you like than add the php include code below to your page where you would like to show random quotes. Make sure your page where you will include it is also php file.
Add this line of code in your php page: <?php include ”random_quote.php”; ?>
The code
<?php
/**
* Add this line of code in your page:
* <?php include "random_quote.php"; ?>
*/
$quotes[] = "This is a quote";
$quotes[] = "This is another";
$quotes[] = "quote 3";
$quotes[] = "quote 4";
$quotes[] = "quote 5";
$quotes[] = "quote 6";
srand ((double) microtime() * 1000000);
$randomquote = rand(0,count($quotes)-1);
echo "<p>" . $quotes[$randomquote] . "</p>";
?>

























