Home >Backend Development >PHP Tutorial >Parsing CodeIgniter custom configuration file_PHP tutorial

Parsing CodeIgniter custom configuration file_PHP tutorial

WBOY
WBOYOriginal
2016-07-21 15:05:29845browse

Sometimes we need to customize configuration files in the CI framework, so how to deal with it? Here’s how to deal with it.
Configuration file config/expert.php

Copy code The code is as follows:

< ?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* Expert configuration file
*
* @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
*/
// Expert ID
$config['expertid' ] = array('0' => '124', '1' => '81', '2' => '136');
?>

Example of getting configuration data
$this->config->load('expert', TRUE);
$expertid = $this->config->item ('expertid', 'expert');

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/327696.htmlTechArticleWe sometimes need to customize configuration files in the CI framework, so how to deal with it? Here’s how to deal with it. Configuration file config/expert.php Copy the code The code is as follows: ?...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn