Uploaded February 2013 | Updated November 2026, 5 hours ago
In this video I will show you the PHP ltrim() function
==============
By default (without a $charlist), ltrim() removes the following whitespace from the left side of a string:
' ' spaces
'\t' tabs
'\n' new lines
'\r' carriage returns
'\0' NUL-bytes
============
Use the form:
ltrim($your_string)
for the default behaviour
============
Or use the form:
ltrim($your_string, $your_charlist)
to specify which characters you want to remove
============
You can specify each character individually ...
============
... or you can use ranges within your character set using the a..z double dot format.
This sample is functionally identical to the previous one.
============
Check out the code on this page for example usage!
============
If you found this video helpful, please subscribe to HelpVideoGuru on YouTube
In this video I will show you the PHP ltrim() function
==============
By default (without a $charlist), ltrim() removes the following whitespace from the left side of a string:
' ' spaces
'\t' tabs
'\n' new lines
'\r' carriage returns
'\0' NUL-bytes
============
Use the form:
ltrim($your_string)
for the default behaviour
============
Or use the form:
ltrim($your_string, $your_charlist)
to specify which characters you want to remove
============
You can specify each character individually ...
============
... or you can use ranges within your character set using the a..z double dot format.
This sample is functionally identical to the previous one.
============
Check out the code on this page for example usage!
============
If you found this video helpful, please subscribe to HelpVideoGuru on YouTube










