Listing10_12.php Reading Characters from a file with fgetc()


BEGIN PHP output
some text here 01 some text here 02 some text here 03 some text here 04 some text here 05 some text here 06 some text here 07 some text here 08 some text here 09 some text here 10 some text here 11 some text here 12 some text here 13 some text here 14 and text added 060611
END PHP output
$filename = "test.txt";
$fp = fopen( $filename, "r" ) or die("Couldn't open $filename");
while ( ! feof( $fp )) {
    $char= fgetc( $fp);
    print "$char";
}

test.txt