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
stringThe input string.
charactersOptional
encodingParameter
Return Values
Returns the modified string.