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.