<html><body>
<?php

/*
Reading files.
Read a line and put it in an array according to the delimiter (in 
this example it's a comma) you specify.
Here (to avoid warnings and may be errors), use 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";
	// Now a priming read.
	$s = fgetcsv($f,10000,','); // Read a line and put it in an array
	while (!feof($f))
	{
		$n = count($s);
		foreach ($s as $k => $val)
		{
			echo $val;
			if ($k < $n - 1)
				echo ", ";
			else
				echo "<BR>"; 
		}
		$s = fgetcsv($f,10000,',');
	}	

	fclose($f);
}

?>
</body></html>
