Answers for "php trim spaces between words"

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
3

php remove space before and after string

$words = '      my words     ';
$words = trim($words);
var_dump($words);
// string(8) "my words"
Posted by: Guest on January-28-2021

Code answers related to "php trim spaces between words"

Browse Popular Code Answers by Language