INI file to multidimensional array in PHP

前端 未结 5 1778
花落未央
花落未央 2021-01-18 08:51

I have the next INI file:

a.b.c = 1
a.b.d.e = 2

I am parsing this file using parse_ini_file. And it returns:

array(
    \'a         


        
5条回答
  •  佛祖请我去吃肉
    2021-01-18 09:28

    Have a look at the Zend_Config_Ini class. It does what you want, you can use it standalone (without the rest of Zend Framework) and as a bonus it supports section inheritance.

    With the toArray method you can create an array from the config object.

提交回复
热议问题