Trimming Line Ends in PHP
Given a string. Clear it of trailing spaces.
Given a string '/php/'. Make it a
string 'php' by removing the trailing slashes.
Given a string 'text text text.'.
There may be a period at the end of this string, or there may
not be. Make sure that there is a period
at the end of this string. That is:
if there is no period - it must be added, and
if there is - do nothing. Solve the problem
via rtrim without any ifs.