array trim 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)
Example 3: array cut only last 5 element
arr.slice(Math.max(arr.length - 5, 0))