1. Concept
The rtrim() function removes whitespace characters or other predefined characters on the right side of a string.
2. Grammar
rtrim(string,charlist)
3. Parameters
string required. Specifies the string to be converted.
charlist Optional. Specifies which characters are removed from a string.
4. Examples
<?php $str = "Hello World!nn"; echo $str; echo rtrim($str); ?>
The above is how to delete characters using the php rtrim() function. I hope it will be helpful to everyone.