rtrim
rtrim is a string processing function used to remove characters from the end of a string. In PHP, rtrim removes any trailing characters that appear in a specified character mask. If no mask is provided, it defaults to removing whitespace characters from the end of the string.
Syntax and parameters: rtrim(string, charlist). The first argument is the input string. The optional second argument,
Behavior and considerations: rtrim only affects trailing characters, not those in the middle or at the start
Examples: rtrim("Hello world ") returns "Hello world". rtrim("foo123", "123") returns "foo".
Related functions: rtrim is the right-side counterpart to ltrim (which trims characters from the left) and trim