note 49935 added to function.rand
| From: | php-general at lists dot php dot net | Date: | Sat, 12 Feb 2005 18:34:58 +0000 |
| Subject: | note 49935 added to function.rand | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-84900@lists.php.net to get a copy of this message | ||
<?php
//A way to make random quotes.
$file="quotefile.txt";
$file=file($file);
$count=count($file);
$i=0;
$rand=rand($i, $count);
echo $rand;
//this will output a random line in a textfile called quotefile.txt
?>
----
Manual Page -- http://www.php.net/manual/en/function.rand.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+49935
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+49935&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+49935&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+49935&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+49935&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+49935&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+49935&report=yes
Search -- http://master.php.net/manage/user-notes.php