I am using ltrim function. I run this code :
echo ltrim("looooooooooooooooooooooooongWord","long");
i expect to get this word : looooooooooooooooooooooooongWord
but it prints Word
.
what's the problem ?
Edit: I thought it remove the word long, but it appears it remove the l,o,n,g characters !
ltrim — Strip whitespace (or other characters) from the beginning of a string
It does exactly as it says, strips chars l, o, n, g.
From the docs: (please read them).
string ltrim ( string $str [, string $character_mask ] )
str
The input string.
character_mask
You can also specify the characters you want to strip, by means of the character_mask parameter. Simply list all characters that you want to be stripped. With .. you can specify a range of characters.