I am simply trying to do what excel calls vlookup using php based on a .csv file
.CSV FILE is the following:
ID;NAME;ADDRESS
123;John;999 Street
123;John;234 Blvd
999;Mark;777 Avenue
I have a textbox for inputting "ID". If I type "123" and press submit I want the following result:
123;John;999 Street
123;John;234 Blvd
This is what I got but I need help
if (($handle = fopen("test.csv", "r")) !== FALSE) {
while (($data = fgetcsv($handle, 1000, ";")) !== FALSE) {
if($data[0] == '123')
array_push($data);
}
fclose($handle);
var_dump($result);
}
?>
...