Answers for "php trim strings in array"

PHP
0

trim elements of array php

$arr = array( " John ", "Jacob ", " Tom ", " Tim ");
$result = array_map('trim', $arr)
Posted by: Guest on June-13-2020
0

trim in php

<?php

$str = "\n\n\nHello World!\n\n\n";

echo "Without trim: " . $str;

echo "<br>";

echo "With trim: " . trim($str);

?>
Posted by: Guest on June-13-2021

Browse Popular Code Answers by Language