View Single Post
Old January 23rd, 2004, 11:08 AM     #2 (permalink)
Carl-cox-
Member
 
Carl-cox-'s Avatar
 
Join Date: Nov 2002
Location: Kent England
Posts: 395
try this

Code:
<?
$files = array('quotes1.txt', 'quotes2.txt', 'quotes3.txt');

$delim = "\n";
foreach($files as $quotefile){
	$i++;
	if($i == 3){
		print " - ";
	}else{
		print " ";
	}
	$fp = fopen($quotefile, "r");
    $contents = fread($fp, filesize($quotefile)); 
    $quote_arr = explode($delim,$contents); 
    fclose($fp); 
    srand((double)microtime()*1000000); 
    $quote_index = (rand(1, sizeof($quote_arr)) - 1); 
    $herequote = $quote_arr[$quote_index]; 
    echo $herequote; 

}
?>
this is the code working
http://coxeh.no-ip.com/test.php

Last edited by Carl-cox- : January 23rd, 2004 at 11:11 AM.
Carl-cox- is offline   Reply With Quote