note 69578 added to function.scandir
| From: | hanif_771 at hotmail dot com | Date: | Mon, 11 Sep 2006 19:29:18 +0000 |
| Subject: | note 69578 added to function.scandir | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-117025@lists.php.net to get a copy of this message | ||
Hi, i got this code to load up a random qutoe from a .txt file.
What I want is for it to load from multiple .txt files, how do i do that?
If u know pls post here.
Thanks
<?php
$file = 'test1.txt';
$conts = file_get_contents($file);
$conts = preg_replace('/<><><>[0-2000]*?<><><>/',
'\n', $conts);
$lines = explode('\n', $conts);
$a = mt_rand(0, sizeof($lines)-1);
echo 'html before here' . $lines[$a] . 'html after here';
?>
----
Server IP: 85.116.0.130
Probable Submitter: 82.5.128.46
----
Manual Page -- http://www.php.net/manual/en/function.scandir.php
Edit -- https://master.php.net/note/edit/69578
Del: integrated -- https://master.php.net/note/delete/69578/integrated
Del: useless -- https://master.php.net/note/delete/69578/useless
Del: bad code -- https://master.php.net/note/delete/69578/bad+code
Del: spam -- https://master.php.net/note/delete/69578/spam
Del: non-english -- https://master.php.net/note/delete/69578/non-english
Del: in docs -- https://master.php.net/note/delete/69578/in+docs
Del: other reasons-- https://master.php.net/note/delete/69578
Reject -- https://master.php.net/note/reject/69578
Search -- https://master.php.net/manage/user-notes.php