PHP: Remove Space at the end of string

There is a string that ends with a single white space. You can use PHP trim function to remove the white space at the end of the string. PHP trim() Function This function not only removes white space at the end of the string but also at the beginning of the string. <?php echo $username; […]