How can complex information be made readonly using define in PHP?

Complex information can be made readonly using the define function in PHP by defining constants for the data that should not be changed. Constants are immutable and cannot be redefined or modified once they are defined using the define function. This ensures that the complex information remains static and cannot be altered during the execution of the script.

define('COMPLEX_INFO', [
    'key1' => 'value1',
    'key2' => 'value2',
    'key3' => 'value3'
]);

// Access the complex information
echo COMPLEX_INFO['key1']; // Output: value1