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.

125 Like 14 Dislike
Previous php-forum Next php-forum
Other php-forum

Retrieving innerHTML with cURL?
Hey all (sorry I know I'm a leecher, but I soon won't be. This is my first PHP project, but not my l

Search in the PHP Files
have to search asterisk(*) in the php code of the php files .
In the html page one text box

Auto install
Hi I have a directory lets say "apps" that I then have more folders ie "email",

PHP form authentication
Hi guys,

what am trying to achieve is this: Whenever a user tries to login to my website, an

socket makes browser hang...
I have a socket server, and I am having a problem at the moment...

A browser sends a http hea

Problem executing bash script using shell_exec
Hi there,
I created a bash script file using following code to convert doc documents to pdf using

Mail sending is slow on server
Why mail is taking time to be send on apache-linux server

Where do I put CRON code
So I've figured out alot about how to automatically run a php function. I can't figure out where to

Please help with code for SMTP authenticated PHP email form
Hello, I'm creating a PHP email form, and for this particular server, I have to use SMTP Authenticat

TemplatePower & AJAX
Hi all,



I'm currently implementing some AJAX features in my PHP-framework (which is b

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