Padding and Stripping a String
For formatting reasons, you sometimes need to modify the string length via either padding or stripping characters. PHP provides a number of functions for doing so. This section examines many of the commonly used functions.
Trimming Characters from the Beginning of a String
The ltrim() function removes various characters from the beginning of a string, including white space, the horizontal tab ( t ), newline ( n ), carriage return ( r ), NULL (