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:

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

noob question
i traying to do a php form with auto replay for both(me and the user who send me a mail),

a u

Help with Password Encoding/Decoding?
Trying to design a "change password" tool. On my signup code I'm using base64_encode, now

What's wrong with my code
sobbing for many days, still don't know why please Help. Why my page isn't posted correctly. In a

xml
<?php

echo "<h1>XML Articles</h1>";

$home

Taking an HTML form and a PHP program and making it into one working file.
Hello,

So I would like to display everything INSIDE a specific directory. In other words, I

animation progress while uploading files?
Hello, i have some website form to upload few files to server. i want to put some gif animation whi

opening a window with after form submission
I know this this forum has nothing to do with JS, but i'm trying to use it with my php script.
<

for some reason mysql query not working, not inserting, please check it out
This code is not inserting anything into my db, don't know why, the $_SESSION variable does contain

Problem with a select distinct
I have a problema with a select distinct, I have the next sql:

select distinct a,b,c,d fr

Why is the logic of this simple code not working?
Hey, I'm trying to determine if a table already exists in mysql, but doing a query first with mysql_

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