how to trim white space array in php
snippet in php

how to trim white space array in php

user8169

$fruit = array('  apple ','banana   ', ' , ',     '            cranberry ');
$trimmed_array = array_map('trim', $fruit);
print_r($trimmed_array);