How can functions be nested within each other for PHP output?

Functions can be nested within each other in PHP by simply defining one function inside another function. This allows for better organization of code and can help in creating modular and reusable code. To nest functions, simply define one function inside the body of another function. Example:

function outerFunction() {
    function innerFunction() {
        echo "Inner function called";
    }
    
    echo "Outer function called. ";
    innerFunction();
}

outerFunction();