使用include方法载入配置文件。
1.php的代码如下:
<?php
$config = include __DIR__ .'/2.php';
var_dump($config);
2.php的代码如下:
<?php
$config['mydbhost'] = 'localhost';
$config['mydbuser'] = 'root';
$config['mydbpwd'] = 'root';
$config['mydbname'] = '80cms1';
$config['mydbcharset'] = 'utf8';
return $config;