PHP/File Directory/readfile

Материал из Web эксперт
Перейти к: навигация, поиск

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

   <source lang="html4strict">

Its syntax is: int readfile (string file [, int use_include_path]) <?

   $restaurant_file = "data.txt";
   print readfile($restaurant_file);

?>

 </source>
   
  


readfile.php

   <source lang="html4strict">

<?php

  $file = "data.txt";
$tags = "

<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); ?> </source>