Continue from this topic link text
Hi guys. I am using codeigniter and want to store data in the session. I have this array
array(4) {
[0]=> array(2) { ["DESC"]=> string(1) "A" ["SUBFUNCTION_ID"]=> string(3) "904" }
[1]=> array(2) { ["DESC"]=> string(1) "B" ["SUBFUNCTION_ID"]=> string(3) "903" }
[2]=> array(2) { ["DESC"]=> string(1) "C" ["SUBFUNCTION_ID"]=> string(3) "902" }
[3]=> array(2) { ["DESC"]=> string(1) "D" ["SUBFUNCTION_ID"]=> string(3) "901" }
}
And this is the array to store the session data
$data = array(
'username' => $this->input->post('username'),
'userid' => $query->USER_ID,
'role' => $query->ROLE_ID,
'is_logged_in' => true
);
How can i manipulate the first array and then append the data into the second array? I want it to become something like this
$data = array(
'username' => $this->input->post('username'),
'userid' => $query->USER_ID,
'role' => $query->ROLE_ID,
'is_logged_in' => true,
'A' => 904,
'B' => 903,
'C' => 902,
'D' => 901
);
Thanks in advance