How to build multi dimensional array for store this?
I want to store information like below with a key like key = activity window then other info under it, then another key etc..
key: 'activity wi开发者_JAVA技巧ndow'
name: 'Recent Activity'
iconCls: 'activity'
module: 'activity-win'
any idea how to put this into a multi dimensional array?
$data = array(
'activity window' => array(
'name' => 'Recent Activity',
'iconCls' => 'activity',
'module' => 'activity-win'
)
);
Is this what you're looking for, or have I completely misunderstood your question?
Like this:
$myArray = array(
'activity window' => array(
'name' => 'Recent Activity',
'iconCls' => 'activity',
'module' => 'activity-win',
),
array(
...
),
);
You can also add on to the array:
$myArray['new key'] = array(
'name' => 'New Name',
'module' => 'New Module',
);
精彩评论