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: 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: 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?

No comments posted yet

Your Answer:

Login to answer
152 Like 54 Dislike
Previous forums Next forums
Other forums

Big O & time complexity ???
can you help me how to calculate the Big O & time complexity for any algorithm and c++ program pleas

Accept only alpha characters
I've got this bit of code ready for accepting a phrase:

Code: if (!eregi ("", $_POS

mysql select query problem
how can i select multiple fields from multiple table in one query like

i have table name t1 a

Preg_match question
I want to use preg_match to make sure a string is always 6 characters long and only contains 0-9 and

Firefox displaying PHP source code??
Currently testing a site thats almost built, am going to be including php on a sidebar on all pages

Shuffle between users ??
I have multiple $users in table. I need to send them $message.

I need to send the next messag

gather checkbox data from form into email
Hello all,

First, i'd like to thank everyone who responded to my previous posts regarding set

Tournament Brackets (Double Elimination)?
Is making a double elimination tournament style bracket system capable of being done in php?

Delete HTML file after loading
I have limited experience with php and its been a year or two since I've last used it. I have a sma

Join Query Help
Hi all,

I am having problems with the below code, which we shall call 'my first join query'!

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