Skip to content

Instantly share code, notes, and snippets.

@kyled09

kyled09/ddealscsv

Last active Dec 22, 2015
Embed
What would you like to do?
CSV Function
<?php
fgetcsv_PHP();
function checkAddress($emailAddress)
{
return time() % 2 == 1 ? TRUE : FALSE;
}
function fgetcsv_PHP()
{
if (($handle = fopen("emailadds.csv", "r")) !== false)
{
while (($data = fgetcsv($handle, "1000", ",")) !== false)
{
//$num = count($data);
if ($data[5] !== "")
{
$emailAddress = $data[5];
//this
print implode(",",$data).(checkAddress($emailAddress) == TRUE? ',YES':',NO')."\n";
//can become ...
/*$output = implode(",",$data);
if(checkAddress($emailAddress) == TRUE){
$output .= ",YES\n";
}else{
$output .= ",NO\n";
}*/
print $output;
}
}
fclose($handle);
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.