What is the significance of the "global" keyword in PHP when declaring variables within functions?

When declaring variables within functions in PHP, by default, those variables are considered local to that function and cannot be accessed outside of it. However, if you need to access a global variable within a function, you can use the "global" keyword to explicitly declare that you want to use the global variable instead of creating a new local one with the same name.

$globalVar = 10;

function myFunction() {
    global $globalVar;
    echo $globalVar;
}

myFunction(); // Output: 10