PHP: Hypertext Preprocessor (original) (raw)

mb_trim

(PHP 8 >= 8.4.0)

mb_trim — Strip whitespace (or other characters) from the beginning and end of a string

Description

Performs a multi-byte safe trim() operation, and returns a string with whitespace stripped from the beginning and end of string. Without the second parameter,mb_trim() will strip these characters:

Parameters

string

The string that will be trimmed.

characters

Optionally, the stripped characters can also be specified using the characters parameter. Simply list all characters that need to be stripped.

encoding

The encodingparameter is the character encoding. If it is omitted or [null](reserved.constants.php#constant.null), the internal character encoding value will be used.

Return Values

The trimmed string.

See Also

Found A Problem?

There are no user contributed notes for this page.