CodeIgniter配置之config.php用法实例分析_PHP

WBOY
Release: 2016-05-28 11:49:10
Original
973 people have browsed it

本文实例分析了CodeIgniter配置之config.php用法。分享给大家供大家参考,具体如下:

配置说明

代码如下:

echo config_item('charset');


CI也提供了一个配置类用来维护配置文件。也可以通过下面方式来获取和设置config的值,当设置之后调用get_config的结果同样会变化,所以可以在某些逻辑前修改config的值。

//获取config中配置的charset值
echo $this->config->item('charset');
//重新设置config中charset的值
$this->config->set_item('charset', 'gbk')
Copy after login

更多关于CodeIgniter框架相关内容感兴趣的读者可查看本站专题:《codeigniter入门教程》

希望本文所述对大家基于CodeIgniter框架的PHP程序设计有所帮助。

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template