Answers for "remove all whitespace in array elements php"

PHP
2

how to trim white space array in php

$fruit = array('  apple ','banana   ', ' , ',     '            cranberry ');
$trimmed_array = array_map('trim', $fruit);
print_r($trimmed_array);
Posted by: Guest on April-28-2020

Code answers related to "remove all whitespace in array elements php"

Browse Popular Code Answers by Language