Trim Values in an Array or Multidimensional Array

and like us on FB

This is a handy reference for trimming values in an associative array. While there’s any number of ways to achieve the result, this works nicely.

A multidimensional array is immune to the above code. The following function will work on a string or array.

Got an easier way? Let us know.