title: removing (case insensitively) duplicates from array while trimming whitespace
body: <p>this is a very similar question to <a href="https://stackoverflow.com/questions/6240544/best-solution-to-remove-duplicate-values-from-case-insensitive-array">Best solution to remove duplicate values from case-insensitive array</a></p>
  
  <p>In the accepted answer the 1st comment mentions using trim() to remove whitespace as well.</p>
  
  <p>I'd like to do this but I can't figure out where the trim should go</p>
  
  <p>can anyone help me?</p>
  
  <pre><code>$r = array_intersect_key($input, array_unique(array_map('strtolower', $input)));
  </code></pre>