<?php

$file 
fopen('/path/to/phrases_file''r') or die("Whoops... Can't open data file!");
$phrases = array();
$num_elem 0;
while (!
feof($file)) {
    
$line fgets($file4096);
    if (
preg_match('/^---$/'$line)) {
        
$num_elem++;
        
$line '';
    }
    
$phrases[$num_elem] .= $line;
}
fclose($file);
list(
$phrase$author) = split('--'$phrases[rand(0$num_elem)]);
$phrase trim($phrase);
$author trim($author);

echo 
"<h2>What is Perl?</h2>\n";
echo 
"<hr>\n";
echo 
"<p><i>$phrase</i></p>\n";
echo 
"<p>-- $author</p>\n";
echo 
"<hr>\n";
echo 
"<p>The document where this phrases were taken from can be found <a href=\"http://www.mit.edu/afs/athena/user/d/a/daveg/perl/what_is_perl\">here</a>.</p>\n";

?>