The rtrim() function is a built-in function in PHP which is used to removes whitespace from the end of a string.
string – This parameter is required. It specifies the string to be checked.
- Space character (” “)
- Tab character (“t”)
- Vertical tab character (“v”)
- Newline character (“n”)
- Carriage return character (“r”)
- Null-byte character (“x0B”)