#native_company# #native_desc#
#native_cta#

Display a random quote

By Andrew
on April 21, 2006

Version: 0.1

Type: Sample Code (HOWTO)

Category: Other

License: GNU General Public License

Description: This code uses an array and a random number to display a quote.

You could change it to be random anything..

<?php
$quotes = array(    
    1=>"quote 1",
    2=>"quote 2",
    3=>"quote 3",
    4=>"quote 4",
    5=>"quote 5",
    6=>"quote 6",
    7=>"quote 7",
    8=>"quote 8",
    9=>"quote 9",
    10=>"quote 10");

$random_number=rand(1, count($quotes));
$random_quote=$quotes[$random_number];
$nums = count($quotes) - 1;
echo "Over $nums qyotes Hit refresh for another quote.<br /><br />";
echo($random_joke);
?>