public static function rstrip($str, $suffix)
    {
        if (substr($str, -strlen($suffix)) == $suffix) {
            return substr($str, 0, -strlen($suffix));
        }
        return $str;
    }
public static function rstrip($str, $suffix)
    {
        if (substr($str, -strlen($suffix)) == $suffix) {
            return substr($str, 0, -strlen($suffix));
        }
        return $str;
    }
public static function rstrip ( $ str , $ suffix ) { if ( substr ( $ str , - strlen ( $ suffix ) ) == $ suffix ) { return substr ( $ str , 0 , - strlen ( $ suffix ) ) ; } return $ str ; }
Strips a suffix of a string

@param string $str
@param string $suffix
@return string
Strips a suffix of a string