File read by char : File Read « File Directory « PHP






File read by char


<html>
<head>
<title>Moving around a file with fseek()</title>
</head>
<body>
<?php
$filename = "test.txt";

$fp = fopen( $filename, "r" ) or die("Couldn't open $filename");
while ( ! feof( $fp ) ){
   $char = fgetc( $fp );
   print "$char<BR>";
}
?>
</body>
</html>


           
       








Related examples in the same category

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