Cosmin
Cosmin

Reputation: 125

Expand ini settings for zend

I'm having the following ini setting file, named networks.ini:

[networks1]
networks[] = 'Twitter'
networks[] = 'Facebook'
networks[] = 'Google'

[networks2 : networks1]
networks[] = 'LinkedIn'

Is there a way to get the array to include for networks2 both the networks1 and networks2 values in the same array? When i try

$cfgNetworks = new Zend_Config_Ini(PATH_TO_INI .'networks.ini', 'networks2');
print_r($cfgNetworks->networks->toArray());

it returns the LinkedIn network name only.

Upvotes: 1

Views: 38

Answers (1)

mleko
mleko

Reputation: 12243

I don't think You can merge arrays this way. But you can try to explicitly add array keys

[networks1]
networks.twitter = 'Twitter'
networks.facebook = 'Facebook'
networks.google = 'Google'

[networks2 : networks1]
networks.linkedin = 'LinkedIn'

Upvotes: 1

Related Questions