Swap/exchange array keys php -


lets have array:

array (     [0] => 18208021789     [1] => ziggo-humax ihdr5050c     [2] => 191.90     [4] =>     [5] => foo bar } 

and want change replace place of [1] [5], result should have:

array (     [0] => 18208021789     [1] => foo bar     [2] => 191.90     [4] =>     [5] => ziggo-humax ihdr5050c } 

how can achieve php?

$tmp=$arr[1]; $arr[1]=$arr[5]; $arr[5]=$tmp; 

Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -