trim - remove white spaces from both ends of a string
- trim
- ltrim
- rtrim
<?php
$str = " some text ";
echo "'$str'";
echo "<br>";
echo trim($str);
?>
White space characters are \n, \r, \t and space itself. ltrim is left trim, rtrim is right trim.