config.php文件中的多维配置
我正在使用codeigniter框架,我想从config.php访问多维配置变量。config.php文件中的多维配置,php,codeigniter,config,Php,Codeigniter,Config,我正在使用codeigniter框架,我想从config.php访问多维配置变量。 例如: $config['user']['students']['cs']='cs USERS' 要访问一维数组,我可以这样做: $this->config->item('user')。 但是如何访问这个多维配置变量呢 问候, Aby在您的配置中,您只需执行以下操作: $config['test']['one'] = 'one'; $config['test']['two'] = 'two'; $config['
例如: $config['user']['students']['cs']='cs USERS' 要访问一维数组,我可以这样做:
$this->config->item('user')。
但是如何访问这个多维配置变量呢 问候,
Aby在您的配置中,您只需执行以下操作:
$config['test']['one'] = 'one';
$config['test']['two'] = 'two';
$config['test']['three'] = 'three';
你怎么做$this->config->item('test')代码>您只需要得到一个数组,它是:
Array
(
[one] => one
[two] => two
[three] => three
)
我能为这个配置$config['user']['students']['cs']做些什么吗?是的,它只会返回一个数组给你。