PHP: Parsing Comma-Separated Values Between Square Brackets into Multi-Dimensional Array

笑着哭i 提交于 2019-12-11 18:49:30

问题


I have the following string:

[aaaa,bbbb,cccc] [aaaa,bbbb,cccc] [aaaa,bbbb,cccc] [aaaa,bbbb,cccc] [aaaa,bbbb,cccc]

and would like to parse this string into a multidimensional array that would look like

0 > ( 0 > aaaa, 1 > bbbb, 3 > cccc), 1 > ( 0 > aaaa, 1 > bbbb, 3 > cccc), 2 > ( 0 > aaaa, 1 > bbbb, 3 > cccc)

How would I do this?

Many Thanks!

来源:https://stackoverflow.com/questions/13735147/php-parsing-comma-separated-values-between-square-brackets-into-multi-dimension

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!