当前位置: 移动技术网 > IT编程>开发语言>PHP > 解析CodeIgniter自定义配置文件

解析CodeIgniter自定义配置文件

2019年04月08日  | 移动技术网IT编程  | 我要评论
我们有时候在ci框架中需要自定义配置文件,那要怎么处理呢?下面就给你介绍处理的办法。
配置文件config/expert.php
复制代码 代码如下:

<?php  if ( ! defined('basepath')) exit('no direct script access allowed');
/**
 * 专家配置文件
 *
 * @author xxx
 * @version $id: expert.php v 1.0 2012/5/31 14:41:00 xxx $
 * @package ask.xxx.com
 * @copyright 1997-2012 www.xxx.com
 */
// 专家id
$config['expertid'] = array('0' => '124', '1' => '81', '2' => '136');
?>

获取配置数据示例
 $this->config->load('expert', true);
 $expertid  = $this->config->item('expertid', 'expert');

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网