Trims whitespace off the right side of a string.
rtrim() works just as trim() but only trims off characters on the right side of the string. The new trimmed string is returned. The optional remove_list parameter can be used to specify which characters should be trimmed off.
<pre>
<?php
$s1 = rtrim(" \t hello there \n");
$s2 = rtrim("--- hello ---", "-");
printf("[%s]<br>[%s]", $s1, $s2);
?>
</pre>
[ hello there]
[--- hello ]
rtrim() is used on two strings, both with and without the use of remove_list.