Generate multilayered array from string.

Posted on 16th Feb 2014 by admin

ok so i have a string that looks like this:
Code: [Select]blog:edit_all,delete_all|users:edit_all,delete_all|settings
and i want to make a code that can take that string and put it in a multi-layered array like this:

Code: [Select]Array
(
[0] => blog
(
[0] => edit_all
[1] => delete_all
)

[1] => users
(
[0] => edit_all
[1] => delete_all
)

[2] => settings
)

i've googled and everything and cant seem to get anything to work. ive come close but not quite.

any ideas?
thank you.

Other forums