I have a config.php
that is included to each page. In config I create an array that looks something like:
$config = array();
$config[\'site_name\
I've solved this with a class:
class Config
{
public static $SiteName = 'My Cool Site';
}
function SomeFunction
{
echo 'Welcome to ' , Config::$SiteName;
}
fcortes' suggestion to use constants is also a good one. I'd only like to suggest to give all constants a prefix, like CFG_SITE_NAME
, so to avoid accidental name clashes with other constants.