英[tr?m] 美[tr?m]
vt. Decorate; trim; organize
adj. Neat, tidy; slender; slender
n .Trim; tidy; healthy state; attire
vi.cut
Third person singular: trims Present participle: trimming Past tense: trimmed Past participle: trimmed Comparative: trimmer Superlative: trimmest
php ltrim() function syntax
How to use the ltrim() function?
php ltrim() function is used to delete spaces or other predefined characters on the left side of a string. The syntax is ltrim(string,charlist) and returns the string processed by charlist rules
Function:Delete spaces or other predefined characters on the left side of the string
Syntax: ltrim(string,charlist)
Parameters:
Parameter | Description |
string | Needs to be processed String |
charlist | is optional and specifies which characters to delete from the string. If it is empty, all the following characters "\0" -- NULL, "\t" -- tab character, "\n" -- line feed, "\x0B" -- vertical tab character, "\r" -- carriage return, " " -- space |
Description: Returns the string processed by charlist rules
php ltrim() function example
<?php $i = " hello world"; echo "未經(jīng)過處理的".$i."左邊是有空格的!"; $j = ltrim($i); echo "經(jīng)過處理的".$j."左邊是沒有空格的!"; ?>
Run instance?
Click the "Run instance" button to view the online instance
Output:
未經(jīng)過處理的 hello world左邊是有空格的!經(jīng)過處理的hello world左邊是沒有空格的