I found this using google.ca, credit not mine. It is much more efficient then my version 🙂
/*
J at TIPPELL dot com
12-Jun-2004 10:18
heres a little script to return a random quote from a quotes file. */
<?php
$textfile = "Includes/Quotes.txt"; //quotes file
if ($quotes = @file("$textfile")) { //don't display errors on file open
$quote = rand(0, sizeof($quotes)-1);
echo $quotes[$quote]; //echo a random quote
}else{
echo ("default quote"); //if quotes file wasn't found, echo out a default quote
}
?>