I have one array i want to use this array in index format. I am using foreach
$role_rights = array();
foreach ($write_read_permission as $k => $val) {
$role_rights['menu_url'][] = $k;
$category = explode("/",$k);
$role_rights['menu_category'][] = $category[0];
if ('read/write' === $val) {
$role_rights['read'][] = 1;
$role_rights['write'][] = 1;
}
if ('read' === $val) {
$role_rights['read'][] = 1;
$role_rights['write'][] = 0;
}
if ('write' === $val) {
$role_rights['read'][] = 0;
$role_rights['write'][] = 1;
}
}
after looping output like this but i don't want this out put
Array
(
[menu_url] => Array
(
[0] => monitoring/tickets
[1] => monitoring/serach_tickets
)
[menu_category] => Array
(
[0] => monitoring
[1] => monitoring
)
[read] => Array
(
[0] => 1
[1] => 1
)
[write] => Array
(
[0] => 1
[1] => 0
)
)
I want output in this formart
Array
(
0 => Array
(
[menu_url] = > monitoring/tickets
[menu_category] => monitoring
[read] => 1
[write] => 0
)
1 => Array
(
[menu_url] = > monitoring/serach_tickets
[menu_category] => monitoring
[read] => 1
[write] => 1
)
)
Is it posssible. If possible please help me!!!