Table of Contents
The ltrim() function is a built-in function in PHP which is used to removes whitespace from the beginning of a string.
Syntax
string – This parameter is required. It specifies the string to be checked.
charlist – This parameter is optional. It specifies which characters are to be removed from the string. These functions will remove the following whitespace characters:
- Space character (” “)
- Tab character (“t”)
- Vertical tab character (“v”)
- Newline character (“n”)
- Carriage return character (“r”)
- Null-byte character (“x0B”)