我有以下ini设置文件,名为networks.ini:
[networks1]
networks[] = 'Twitter'
networks[] = 'Facebook'
networks[] = 'Google'
[networks2 : networks1]
networks[] = 'LinkedIn'
有没有办法让数组包含在networks2中的networks1和networks2值在同一个数组中? 当我尝试
$cfgNetworks = new Zend_Config_Ini(PATH_TO_INI .'networks.ini', 'networks2');
print_r($cfgNetworks->networks->toArray());
它仅返回LinkedIn网络名称。
答案 0 :(得分:1)
我不认为您可以通过这种方式合并数组。 但您可以尝试显式添加数组键
[networks1]
networks.twitter = 'Twitter'
networks.facebook = 'Facebook'
networks.google = 'Google'
[networks2 : networks1]
networks.linkedin = 'LinkedIn'