Skip to content

Instantly share code, notes, and snippets.

@perceptum
Forked from kyled09/ddealscsv
Last active December 22, 2015 17:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save perceptum/6506341 to your computer and use it in GitHub Desktop.
Save perceptum/6506341 to your computer and use it in GitHub Desktop.
<?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