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

mb_rtrim

PHP function Edit on GitHub ✎

(PHP 8 >= 8.4.0)

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

Description

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

Performs a multi-byte safe rtrim() operation, and returns a string with whitespace (or other characters) stripped from the end of string.

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

Unicode

Parameters

string

The input string.

characters

Optional

encoding

Parameter

Return Values

Returns the modified string.

See Also

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