Hello so I have this csv check that breaks when the zipcode isn't in the csv. pretty logical because my csv file is really big (around 12000 lines). but I don't know what else to do.
so I'm using cookies because I want to show the results in my javascript table.
the code should work like this:
$zipcode = "5483 XK";
$housenumber = 46;
if zipcode + housenumber combo is in db send a true cookie
if they don't exist send false cookie
can someone help me
$csv_file = "NewPostcodesCheckt.csv";
$file_handle = fopen($csv_file, "r");
while (($row_data = fgetcsv($file_handle, 1000, ';')) !== FALSE) {
if ($row_data[0] == $Zipcode && $row_data[1] == $Housenumber ) {
setcookie('cookie_test', 'true' , time() + 1000);
break;
}else{
setcookie('cookie_test', 'false', time() + 1000);
}
}
fclose($file_handle);
What I have tried:
the example above is what I tried. I also tried giving both a break but then they would only check the first row
this is the error that you get:
net::ERR_RESPONSE_HEADERS_TOO_BIG