Click here for rtrim function details, and here for its alias chop function.
For information on PHP Multibyte String support, click here.