How does PHP realize that the array key name is unchanged and the values are interchangeable?

$arr = array("a"=>"aaa","b"=>"bbb");

$arr = array("a"=>"bbb","b"=>"aaa");
Php
Mar.05,2021

$arr = array('a'=>'aaa','b'=>'bbb');
$arr_new = array_combine(array_keys($arr),array_reverse(array_values($arr)));
var_dump($arr_new);

=
Oh, too late, @ panda mulberry claw


the code is a little bad, if there is a better way, welcome to communicate:

  

create a new temporary variable to store

Menu