Current Location: Home> Function Categories> ltrim

ltrim

Remove spaces (or other characters) from the beginning of the string
Name:ltrim
Category:String
Programming Language:php
One-line Description:Removes whitespace or other characters to the left of the string.

Definition and usage

ltrim() function removes whitespace characters or other predefined characters to the left of the string.

Related functions:

  • rtrim() - Removes whitespace or other predefined characters to the right of the string
  • trim() - Remove whitespace or other predefined characters on both sides of the string

grammar

 ltrim ( string , charlist )
parameter describe
string Required. Specifies the string to be checked.
charlist

Optional. Specifies which characters to delete from the string. If this parameter is omitted, all the following characters are removed:

  • "\0" - NULL
  • "\t" - Tab
  • "\n" - Line break
  • "\x0B" - Vertical tab character
  • "\r" - Enter
  • " " - Spaces
Similar Functions
Popular Articles