PHP ltrim() Function
Definition
The ltrim()
function trims whitespace from the lefthand side of a string.
Syntax
PHP ltrim() Function has the following syntax.
string ltrim ( string str [, string trim_chars] )
Parameter
The optional second parameter to trim() sets the individual characters you want it to trim.
Return
PHP ltrim() Function returns the left trimmed string.
Example
Trim a string from left
<?PHP/* w w w .j av a2 s. c o m*/
$string = ltrim(" java2s.com ");
print( ">"+$string+"<");
?>
The code above generates the following result.