php - How can I trim all strings in an Array? -


this question has answer here:

if have array:

array("  hey  ", "bla  ", "  test"); 

and want trim of them, how can that?

the array after trim:

array("hey", "bla", "test"); 

array_map() need:

$result = array_map('trim', $source_array); 

Comments

Popular posts from this blog

javascript - Iterate over array and calculate average values of array-parts -

iphone - Using nested NSDictionary with Picker -

objective c - Newbie question -multiple parameters -