The ltrim()
function trims whitespace from the lefthand side of a string.
PHP ltrim() Function has the following syntax.
string ltrim ( string str [, string trim_chars] )
The optional second parameter to trim() sets the individual characters you want it to trim.
PHP ltrim() Function returns the left trimmed string.
Trim a string from left
<?PHP
$string = ltrim(" java2s.com ");
print( ">"+$string+"<");
?>
The code above generates the following result.