PHP使用include方法载入配置文件

1.php的代码如下:


$config = include __DIR__ .'/2.php';
 
var_dump($config);

2.php的代码如下:


$config['mydbhost'] = 'localhost';
$config['mydbuser'] = 'root';
$config['mydbpwd'] = 'root';
$config['mydbname'] = '80cms1';
$config['mydbcharset'] = 'utf8';
return $config;

你可能感兴趣的:(PHP,php,java,android)