How do I go about making the following array:
Array
(
[0] => Array
(
[r_id] => 1
[r_rate] => 180.00
)
[1] => Array
(
[r_id] => 2
[r_rate] => 100.00
)
[2] => Array
(
[r_id] => 3
[r_rate] => 100.00
)
[3] => Array
(
[r_id] => 4
[r_rate] => 100.00
)
)
Look like this: (array value r_id = array key, with a value of r_rate)
Array
(
[1] => 180.00 // [r_id] => [r_rate]
[2] => 100.00
[3] => 100.00
[4] => 100.00
)
I have tried using array_flip
and array_merge
and looping through the array, but with very little success. The array name is $r_id
.