I got the following array , as a result from the MySQL query:
Array
(
[0] => Array
(
[id] => 11
[owner] => Mark
)
[1] => Array
(
[id] => 10
[owner] => David
)
[2] => Array
(
[id] => 9
[owner] => Poul
)
[3] => Array
(
[id] => 8
[owner] => Peter
)
[4] => Array
(
[id] => 7
[owner] => Peter
)
[5] => Array
(
[id] => 6
[owner] => Lucas
)
)
Is there a way to modify it, using the PHP functions and ommit the foreach process?
I would like it to look following:
Array
(
11 => Mark
10 => David
9 => Poul
8 => Peter
7 => Peter
6 => Lucas
)
So , basicly it should build this array from the id and the owner values. Like id => owner.
Is that possible?
foreach. Why you want to make workaround?