Populate Array with values from another arrray [closed]

You can easily use foreach to achieve that,

$my_array = array();
foeach($wpArray as $row){
   $my_array[$row->ID] = $row->post_name;
}