Code: Select all
function check_email_exists($email) {
// Check if email already exists
$efile = fopen("data/email_listing.txt", "rb");
$address = fgets($efile);
while(!feof($efile)){
// compare strings, length of first string is the length
if (strncasecmp($email, $address, strlen($email)) == 0) {
return false;
} else {
return true;
}
$address = fgets($efile);
}
fclose($efile);
}