ltrim()


string ltrim (string $str [, string $charlist ])

Description

ltrim() strips a white space (or other characters) from the beginning of a string

※ available F/W version : all

Parameters

Return values

Returns the modified string, PHP error on error

Example

<?php
hexdump(ltrim("\x0b\x00\x0d\x0a\x09\x20ABCDEFG\x0b\x00\x0d\x0a\x09\x20"));
// OUTPUT: 0000  41 42 43 44 45 46 47 0b  00 0d 0a 09 20           |ABCDEFG.....    |

echo ltrim(".0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.", "0123.45678"), "\r\n";
// OUTPUT: 9ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.

echo ltrim(".0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.", "0..3....4..8"), "\r\n";
// OUTPUT: 9ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.
?>

See also

trim() / rtrim()

Remarks

This function is identical to the PHP group’s ltrim() function.