Updated
You can try this with array_column () -
$new = array_column($arr, 'name', 'uid');
Demo
Note: array_column() not available for PHP <5.5
If you are using lower versions of PHP , use a loop.
$new = array(); foreach($your_array as $array) { $new[$array['uid']] = $array['name']; }
Sougata bose
source share