$fh = @fopen("csv_file_name", "r");
if($fh) {
if(flock($fh, lock_ex)) {
while(!feof($fh)) {
$line = fgets($fh);
if(strstr($line, $target_email_address) !== false) {
$data = split(",", $line); // $data *is* an array
}
}
flock($fh, lock_un);
}
fclose($fh);
}
|