trim - remove white spaces from both ends of a string



examples/intro/trim.php
<?php
   $str = "   some text  ";
   echo "'$str'";
   echo "<br>";
   echo trim($str);
?>
   

trim White space characters are \n, \r, \t and space itself. ltrim is left trim, rtrim is right trim.