How can the function "right" be simplified to improve readability and maintainability?

The function "right" can be simplified by removing unnecessary complexity and improving variable naming for better readability and maintainability. This can be achieved by using a more descriptive name for the function and breaking down the logic into smaller, more easily understandable steps.

// Simplified version of the "right" function
function getRightSubstring($string, $length) {
    $rightSubstring = substr($string, -$length);
    
    return $rightSubstring;
}