note 43183 deleted from function.file by tularis

From: Date: Fri, 30 Nov 2007 12:16:12 +0000
Subject: note 43183 deleted from function.file by tularis
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-132686@lists.php.net to get a copy of this message
Note Submitter: J at TIPPELL dot com ---- 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 } ?>

« previous php.notes (#132686) next »