Thread
:
PHP: How to pick ~15 lines of text from a textfile and put them on my site?
View Single Post
03-24-2006, 03:50 PM
pstation
Confirmed User
Join Date: Jul 2003
Location: chicago
Posts: 1,135
pretty simple...
Code:
<?php $a = file("somefile.txt"); for($b=0;$b<15;$b++) echo $a[array_rand($a)]; ?>
just off the top of my head, there's always a chance that you might get a duplicate line but it should give you a good start..
pstation
View Public Profile
Find More Posts by pstation