$input = array("a" => 1, "b" => 1, "c" => 2); $flipped = array_flip($input); print_r($flipped); # Output Array ( [1] => b [2] => c )