Answers for "how to remove white spaces values from array php"

PHP
0

remove every whitespace php

$string = preg_replace('/s+/', '', $string);
Posted by: Guest on May-29-2020
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 "how to remove white spaces values from array php"

Browse Popular Code Answers by Language