How can global variables be used to access constants in PHP?

Global variables can be used to access constants in PHP by defining the constants outside of any function or class, making them globally accessible. To access these constants within a function or method, you can use the `global` keyword followed by the constant name to reference the global variable holding the constant value.

define('PI', 3.14);

function calculateCircleArea($radius) {
    global $PI;
    return $PI * $radius * $radius;
}

echo calculateCircleArea(5); // Output: 78.5