I have arrays structured like below:
array(2) {
["uid"]=>
string(2) "39"
["name"]=>
string(18) "Manoj Kumar Sharma"
}
array(2) {
["uid"]=>
string(2) "47"
["name"]=>
string(11) "S kK Mishra"
}
I want these array should be like this below:
array(4) {
[39]=>
string(18) "Manoj Kumar Sharma"
[47]=>
string(11) "S kK Mishra"
}
How can i achieve this ? Please help me.
foreach, then assign it in another array usinguidas the key andnameas the value, you can just trymultidimensional arraybut you need it to be that way - you can just make itmultidimensional array. So, where is the difference, exactly?