readfile.php : readfile « File Directory « PHP






readfile.php

 
<?php
   $file = "data.txt";

   $tags = "<h2><h3><p><b><a><img>";

   $fh = fopen($file, "rt");

   while (!feof($fh))
      $article .= fgetss($fh, 1024, $tags);

   fclose($fh);

   $fh = fopen($file, "wt");
   fwrite($fh, $article);
   fclose($fh);

   $bytes = readfile($file);
?>
  
  








Related examples in the same category

1.readfile() function reads in a file and outputs it to standard output.