trim elements of array php
snippet in php

trim elements of array php

user3687

$arr = array( " John ", "Jacob ", " Tom ", " Tim ");
$result = array_map('trim', $arr)