trim string in array php code example
Example 1: php trim all array elements
$result = array_map('trim', $source_array);
Example 2: trim elements of array php
$arr = array( " John ", "Jacob ", " Tom ", " Tim ");
$result = array_map('trim', $arr)