September 2001
Intermediate to advanced
768 pages
32h 45m
English
string ltrim(string string) Removes whitespace from the left end of a string.
Returns:
String; FALSE on error
Description:
ltrim() removes all whitespace from the left end of a string. The function considers the following characters to be whitespace:
| Character Name | ASCII Value | PHP Character Escape Sequence |
|---|---|---|
| null | 0 | \0 |
| tab | 9 | \t |
| newline | 10 | \n |
| vertical tab | 11 | none |
| carriage return | 13 | \r |
| space | 32 | none |
Version:
PHP 3+, PHP 4+
See also:
To trim space from both ends of a string:
trim()
To trim space from the right end of a string:
chop() rtrim()
Example:
<?php $string = "\t\tA red bird, ink tore thy eye.\t\t"; echo "Original string : '$string'\n", "ltrim()'d string: '", ltrim ($string), "'"; ... |
Read now
Unlock full access