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:

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

Unable to display contents in Second Drop Down Box
Hi All,

What I am trying to do is 2 dependent drop down boxes and when user selects su

multiple recipients + dbuser mail recall
Hello,

I am building a php login script.

When the user registers the script will send

Update Database
Hi All,


I have a problem with this:

Code: [Select]<?php
session_start();

echo $rows help
Hi all,

Hopefully something simple that I don't know!

I have this:

Code: [Selec

preg_replace question
Hello!!

I hope someone can help me with preg_replace.

I load two tables from an extern

Help With editting and deleting form
Hallo !!

So look at this image :

http://img194.imageshack.us/img194/8272/snapshot5f.pn

Is there a way to override built in php functions without APD?
I am trying to use the
rename_function()
override_function()
options that are built into

$GPRMC and NMEA how to extract from report
Hi There,

Im a little bi lost and not sure where to start with this one, ive got a small gps

filesize problem
i use ubuntu 9.10 and i have mountet a folder from an windows

/mount/FOLDER
/mount/FOLDER/

Reg Ex
Im trying to search for the string: srv_9 (Dead ???)

I thought to use preg_match, however I d

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