What's the best way to create variables that can be used from file to file and even object to object? Example:
The settings file would contain an array like this:
<?php
$config = array(
'key1' => 'val1',
'key2' => 'val2'
);
?>
<?php
class config {
function get_data($file){
require_once('config/'.$file.'.php');
foreach($config as $key => $val){
$this->$key = $val;
}
}
}
?>