Generate multilayered array from string.


Posted on 16th Feb 2014 07:03 pm 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:

Did you know?Explore Trending and Topic pages for more stories 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.
No comments posted yet

Your Answer:

Login to answer
125 Like 14 Dislike
Previous forums Next forums
Other forums

Help with parsing this html
Hi,
I've got some html i just need a couple of strings from.. argh, it's freaking me out. I've t

PHP friend keyword equivalent
is there a PHP equivalent for the C++ friend keyword?

calendar dates and hours compare problem
i have a calendar in wordpress, everything works great except that i can make 2 meetings at the same

How to write on database when a link is clicked?
Hi, I have a list of products in a gridview. When the link is clicked currently it takes to an ext

Check before inserting in DB ???
This is my code
---------------
if ( $_POST ['Submit'])
{{
$username = $_POST ['usernm

help with image upload code
Hello,

right now this code I have resizes images and then places them into the uploads folder

File upload issues
Hi Guys,

Can anyone see any issues with this code:
Code: $setImage= 'productimages/' . dat

Detail Expenses Report by Cost Center
I would like to obtain a report out of SAP that shows a list of expenses by cost center that shows t

Compare user input to flat file data
Help...Am a complete newbie to programming so my code is prolly quite long. Am trying to verify a us

Character Set Setup
Whats the best character set to use if you want every character to work, and also how do you make yo

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash