function RandomLine($filename) { $lines = file($filename) ; echo $lines[array_rand($lines)] ; } RandomLine("quotes.txt"); ?>