I have following array:
$sections = array(
0 => array(
'id' => 'betrothed_details',
'name' => 'About us',
'order' => '1',
'menu_name' => '',
'display' => '1'
),
1 => array(
'id' => 'events',
'name' => 'Events',
'display' => '1',
'order' => '2',
'menu_name' => ''
),
2 => array(
'id' => 'gallery',
'name' => 'Gallery',
'order' => '3',
'menu_name' => '',
'display' => '1'
),
);
I created drag and drop sorting, wchich passes the id's in the correct order, like
$ids = array('events','betrothed_details','gallery')
For each of the $ids array I would need to change the appropriate order value in $sections array.
$i = 1;
foreach ($ids as $id) {
CHANGE THE ORDER VALUE HERE to $i
$i++;
}
How is this done?