title: How can I explode and trim whitespace?
body: <p>For example, I would like to create an array from the elements in this string:</p>
  
  <pre><code>$str = 'red,     green,     blue ,orange';
  </code></pre>
  
  <p>I know you can explode and loop through them and trim:</p>
  
  <pre><code>$arr = explode(',', $str);
  foreach ($arr as $value) {
      $new_arr[] = trim($value);
  }
  </code></pre>
  
  <p>But I feel like there's a one line approach that can handle this. Any ideas?</p>