Thread
:
PHP: Displaying random lines from text file
View Single Post
12-23-2008, 06:25 PM
eMonk
Confirmed User
Industry Role:
Join Date: Aug 2003
Location: Canada
Posts: 2,310
Quote:
Originally Posted by
NickSunshine
PHP Code:
<?
$a=file('filename.txt');
$b=array_rand($a);
print($a[$b]);
?>
Error: Warning: array_rand() [function.array-rand]: First argument has to be an array.
Do I need anything special in my text file?
eMonk
View Public Profile
Find More Posts by eMonk