Many time we want to trim array value dynamically. But we always go with foreach and trim that value.
If we are not aware from “array_map” function then we used simply foreach function and used trim function.
But its better to use following function. It will directy trim all value of array.
$arr = array(' Jainish ',' S ',' Senjaliya '); $trimmed_array = array_map('trim',$arr); print_r($trimmed_array);
If you have any queries, please do not hesitate to contact me at Jainish Senjaliya