YellowKard
03-20-2001, 11:37 PM
I was wondering how I could use a vb template called quotereply_quotes instead of an external .txt file for the following code:
$quotefilepath = "quotes.txt";
function randomline($filename) {
$file = file($filename);
srand((double)microtime()*1000000);
while ($randomquote == "") {
$randomquote = ereg_replace("\n","",$file[rand(0,count($file))]);
}
return $randomquote;
}
$quote = randomline("$quotefilepath");I had to use [ code ] and not [ php ] because [ php ] stripped my code's slashes.
$quotefilepath = "quotes.txt";
function randomline($filename) {
$file = file($filename);
srand((double)microtime()*1000000);
while ($randomquote == "") {
$randomquote = ereg_replace("\n","",$file[rand(0,count($file))]);
}
return $randomquote;
}
$quote = randomline("$quotefilepath");I had to use [ code ] and not [ php ] because [ php ] stripped my code's slashes.