thinkphp5生成扩展配置文件和获取配置文件中的内容

tech2022-09-15  98

thinkphp5生成和修改配置文件

例如:

//扩展文件的路径 此路径为application/extra/webconfig.php $filename = APP_PATH . "extra" . DS . "webconfig.php"; //数据内容 $data = ['web_title'=>"csdn"]; //保存内容到文件 put_array($data, $filename);

thinkphp5获取配置文件中的内容

例如:

//获取配置文件中指定的内容 $web_title = \think\Config::get('webconfig.web_title'); //获取配置文件中的全部内容 $webconfig = \think\Config::get('webconfig');
最新回复(0)