Reading Specific Data from a File : File Read « File Directory « PHP






Reading Specific Data from a File

<?php
  $myfile = "./test.txt";
  $openfile = fopen ($myfile, "r") or die ("Couldn't open the file");

  $filesize =filesize($myfile);
  fseek ($openfile, 8);
  $sp_data = fread ($openfile, ($filesize - 8)) ;

  print $sp_data;
?>

           
       








Related examples in the same category

1.Reading a Specific Character
2.Using fgets() and feof() Functions
3.Reading from a File
4.Opening and Reading a File Line by Line
5.Reading a File with fread()
6.File read by char