Welcome Guest, Not a member yet? Register   Sign In
Accessing config file arrays
#1

[eluser]Unknown[/eluser]
Hi!

I'm interested, is there a method to simplify accessing an array inside a config file.

my_config.php:
Code:
$config['my_array'] = array(
   'key1' => 'value1',
   'key1' => 'value2'
);

Works:
Code:
$this->config->load('my_config');
$values = $this->config->item('my_array');
echo $values['key1'];

Doesn't work:
Code:
$this->config->load('my_config');
echo $this->config->item('my_array')['key1'];

Question is - is it possible to make it work (what changes do i need to do) ??

Sorry, for my english Smile,
Thanks !


Messages In This Thread
Accessing config file arrays - by El Forum - 10-07-2007, 12:15 PM
Accessing config file arrays - by El Forum - 10-08-2007, 05:03 AM



Theme © iAndrew 2016 - Forum software by © MyBB