fgetss.php : fgetss « File Directory « PHP






fgetss.php

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

   $fh = fopen("article.html", "rt");

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

   $fh = fopen("article.html", "wt");
   fwrite($fh, $article);
   fclose($fh);
?>
  
  








Related examples in the same category

1.fgetss() strips all HTML and PHP tags from the file: string fgetss (int filepointer, int length [, string allowable_tags])
2.Stripping all but a select few tags from an HTML file