<?php
/* using files */
$filename = "quotes.txt";
$filevar = fopen($filename, 'w') or die("can't open file");
/* creating - writing */
fwrite ($filevar, "Baseball is ninety percent mental and the other half is physical.\n");
$quote2 = "If you come to a fork in the road, take it.\n";
fwrite ($filevar, $quote2);
fclose($filevar);
/* appending */
$filevar = fopen($filename, 'a') or die("can't open file");
$quote3 = "It's like deja-vu, all over again.\n";
fwrite ($filevar, $quote3);
fclose($filevar);
/* reading */
$filevar = fopen($filename, 'r') or die("can't open file");
echo "<div style='font-size:22px;color:#990000;'>";
while (!feof($filevar))
{
$quote = fgets ($filevar);
echo "<p><i>$quote</i></p>";
}
echo "</div>";
fclose ($filevar);
/* deleting file */
unlink ("quotes.txt");
?>