View Single Post
Old 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 View Post
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 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote