note 54030 deleted from function.rand by felipe

[email protected]
Newsgroups php.notes
Message-ID <[email protected]>
Note Submitter: emailfire at gmail dot com 

----

To get a random quote in a file use:

<?
$file = "quotes.txt";
$quotes = file($file);
echo $quotes[rand(0, sizeof($quotes)-1)];
?>

quotes.txt looks like:

Quote 1
Quote 2
Quote 3
Quote 4
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.