php8.5
Home/ Manual/ mbstring / functions/ mb_ltrim

mb_ltrim

PHP function Edit on GitHub ✎

(PHP 8 >= 8.4.0)

Strip whitespace (or other characters) from the beginning of a string

Description

mb_ltrim(string $string, string|null $characters = null, string|null $encoding = null): string

Performs a multi-byte safe ltrim() operation. Strip whitespace (or other characters) from the beginning of a string.

Without the second parameter, mb_ltrim() will strip these characters:

Unicode

Parameters

string

The input string.

characters

Optional

encoding

Parameter

Return Values

This function returns a string with whitespace stripped from the beginning of string.

See Also

Source: reference/mbstring/functions/mb-ltrim.xml · from the official PHP manual (php/doc-en)