I have tried this line of code to display an array:
foreach($users_array as $value){
echo "<pre>";
print_r($value);
}
Which display this kind of array.
Array
(
[auto_id] => 45
[id] => 20151116
[name] => Peter 2
[department] =>
[position] =>
[rate] => 300
[date_added] => 2017-07-26 09:31:44
)
Array
(
[auto_id] => 80
[id] => 20160410
[name] => John 2
[department] =>
[position] =>
[rate] => 400
[date_added] => 2017-07-26 09:31:48
)
Now what I wanted to do is to make the id of employee to be the key of an array and make them as one multi-dimensional array.
Example output should be like this:
Array
(
[20151116] => Array
(
[auto_id] => 45
[id] => 20151116
[name] => Peter 2
[department] =>
[position] =>
[rate] => 300
[date_added] => 2017-07-26 09:31:44
)
[20160410] => Array
(
[auto_id] => 80
[id] => 20160410
[name] => John 2
[department] =>
[position] =>
[rate] => 400
[date_added] => 2017-07-26 09:31:48
)
)
Any help is appreciated. Thank you.