how to trim every word in an array python code example Example: php trim all array elements $result = array_map('trim', $source_array);