I'm trying to compare two arrays.
I have a fixed array in my code. If the array (extracted from a csv) does not match the fixed array, the values that are deviating from the fixed array should be returned? How can I achieve this?
What I have tried;
$columnsFromFile = array_filter(array_map('trim', array_map('strtolower', $line)));
$differences = array_diff_key($columnsFromFile, CsvFile::CSV_COLUMNS);
I've also tried something like this;
$differences = array_merge(CsvFile::CSV_COLUMNS, array_diff_key($columnsFromFile, CsvFile::CSV_COLUMNS));
But the actual matches is returned.