Change index of an array
===

I want to change the index of an array but I don't know how to do it..
The following array

    array(
    0 => array ( 'id' => 33, 'name' => 'test' )
    1 => array ( 'id' => 37, 'name' => 'test2' )
    )

should become - if i want the index

    array(
    33 => array ( 'id' => 33, 'name' => 'test' )
    37 => array ( 'id' => 37, 'name' => 'test2' )
    )

or if i want the name

    array(
    test => array ( 'id' => 33, 'name' => 'test' )
    test2 => array ( 'id' => 37, 'name' => 'test2' )
    )