I have a CSV file which has many rows in, like the following:
Client Product Quantity Unit Amount Total 1 Prod1 1 10 10 1 Prod2 2 15 30 2 Prod1 2 12 24 2 Prod2 1 5 5
etc...
i want to be able to import the CSV file using PHP and group each client together and display the total cost for each client.
I have my import function etc...
if(is_uploaded_file($_FILES['file']['tmp_name'])) {
echo "<h3>" . "File ". $_FILES['file']['name'] ." uploaded successfully." . "</h3><br><br>";
}
$handle = fopen($_FILES['file']['tmp_name'], "r");
fgetcsv($handle);
//then loop through each row
while(($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
}
but im not sure what to do inside the while loop
if possible, i want to do this without using a database