Hi i'm just starting to mess with PHP and i want to make the usual random quote generator.
I have the quotes stored in a flat file. (one per line).
I've got my old perl version. Just wondering the best way to convert it into PHP.
thx
#!/usr/bin/perl
use IO::File;
use strict;
#constants
my $qFile = "/var/www/htdocs/quotes.txt";
#variable type things.
my $line;
my @list;
print "Content-type: text/html\n\n";
open (QUOTES, "< $qFile") or die "Can't open $qFile\n";
while ($line = <QUOTES>) {
push @list, $line;
}
srand;
print @list[rand(@list)];