array_flip(array)
$array = ["A" => 10, "B" => 20, "C" => 30, "D" => 40]; $result_array = array_flip($array); print_r ($result_array); // outputs : // [10] => A // [20] => B // [30] => C // [40] => D
Pro tip: use ```triple backticks around text``` to write in code fences