I've just created this. I think this will be quicker to store and then read the CSV data.
function load_csv($file,$identifier,$commission,$purchase_value)
{
$lines = file($file) or die('Could not open file');
foreach($lines as $line)
{
$row_data = explode(",", $line);
$new_row[0] = $row_data[$identifier];
$new_row[1] = $row_data[$commission];
$new_row[2] = $row_data[$purchase_value];
$transaction_data[] = $new_row;
} return $transaction_data;
}
Is there any better way than this? Or can this code be easily improved?
Help appreciated Thanks.