<html><body>
<?php

/*
Reading files.
Reading the file character by character.
Here you can do without a priming read.
*/

// Try to open the file
@ $f = fopen('/home/abu-jeib/temp/abc.txt','rb');
if (!f)
{
	echo "ERROR: file can't be opened.<P>\n";
	exit;
}
else
{
	echo "Name, Grade<P>\n";
	$s = fgetc($f); // Read a single character (priming read).
	while (!feof($f))
	{	
		if ($s == "\n") // Don't use single quotes here
				// Do not use single quotes when
				// white space characters are involved
			echo "<BR>\n";
		else
			echo $s;
		$s = fgetc($f); // Read a single character.
	}

fclose($f);
}

?>

</body></html>
