➤ The array_flip() function flips/exchanges all keys with their associated values in an array. Syntax:
array_flip(array)
For instance:
$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
by Levani Makhareishvili
2 years ago
PHP
Function
1
Pro tip: use ```triple backticks around text``` to write in code fences