Ok here you go
// the column-array.php is just the array matching that in the data.csv.
require_once("column-array.php");
$fp = fopen("data.csv", "r");
// getZip not used this version
function getZip($full)
{
$pieces = explode(' ', $full);
$zip = explode('(', $pieces[count($pieces)-1]);
$zip = explode(')', $zip[1]);
return $zip[0];
}
$pre="";
while (($data = fgets($fp,4096)) !== FALSE)
{
$data=str_replace("\r\n","",$data);
if(trim($data)=="" or substr($data,strlen($data)-1,1)!='"' or substr($data,strlen($data)-2,2)==',"')
{
$pre.=$data;
}
else
{
$data=$pre.$data;
$data=str_replace(array(',""','","','"',"'","html","\r\n"),array("","|","","","PHP"," "),$data);
$data=preg_replace("/\r|\n|\v|\r\n/smUi"," ",$data);
$data_elements=explode("|",$data);
}
////////////////////////////////////////////////////////////////////////////
// USED TO ECHO FIELD COLUMNS IN A TABLE - Used For Testing Output
////////////////////////////////////////////////////////////////////////////
echo("<table border=2 cellpadding=5 cellspacing=5>");
$i++;
echo("<tr>");
foreach($data_elements as $k)
{
echo("<td valign=top width='20' style='overflow:hidden;'>");
echo($k);
echo("</td>");
}
echo("</tr>");
echo("</table>");
continue;
$listings++;
//}
}
fclose($fp);