mb_trim
PHP function
Edit on GitHub ✎
(PHP 8 >= 8.4.0)
Strip whitespace (or other characters) from the beginning and end of a string
Description
mb_trim(string $string, string|null $characters = null, string|null $encoding = null): string
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:
Unicode
Parameters
stringThe
stringthat will be trimmed.charactersOptional
encodingParameter
Return Values
The trimmed string.