this is a very similar question to Best solution to remove duplicate values from case-insensitive array
In the accepted answer the 1st comment mentions using trim() to remove whitespace as well.
I'd like to do this but I can't figure out where the trim should go
can anyone help me?
$r = array_intersect_key($input, array_unique(array_map('strtolower', $input)));