How to recursively create a multidimensional array?

前端 未结 5 1766
无人及你
无人及你 2020-12-17 06:47

I am trying to create a multi-dimensional array whose parts are determined by a string. I\'m using . as the delimiter, and each part (except for the last) shoul

5条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-17 07:26

    Gumbo's answer looks good.

    However, it looks like you want to parse a typical .ini file.

    Consider using library code instead of rolling your own.

    For instance, Zend_Config handles this kind of thing nicely.

提交回复
热议问题