<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.
*/

$file = '/home/abu-jeib/temp/address.txt';
// Try to open the file
@ $f = fopen($file,'rb');
if (!$f)
	exit("ERROR: file can't be opened.<P>\n");

echo "Name, Email, Address<P>\n";
$s = fgetcsv($f,10000,','); // Read a line and put it in an array
while (!feof($f))
{
	foreach ($s as $v)
		$v = trim($v);
	echo "$s[0], ";
	if (!empty($s[1]))
		echo "<a href=\"mailto:'$s[1]'\">$s[1]</a>, ";
	else
		echo "No Email Provided, ";
	echo "$s[2],  $s[3] $s[4]<br>\n";
	$s = fgetcsv($f,10000,',');
}	

fclose($f);

?>
</body></html>
