supprimer chaque php blanc
$string = preg_replace('/\s+/', '', $string);
LunkLoafGrumble
$string = preg_replace('/\s+/', '', $string);
$fruit = array(' apple ','banana ', ' , ', ' cranberry ');
$trimmed_array = array_map('trim', $fruit);
print_r($trimmed_array);