How can the array_flip function be used effectively in PHP to achieve a specific goal?

Issue: If you have an array where the keys and values need to be swapped, you can use the array_flip function in PHP to achieve this. This can be useful when you need to quickly switch the keys and values of an array. Example PHP code snippet:

// Original array
$originalArray = array("apple" => "red", "banana" => "yellow", "grape" => "purple");

// Flipping the keys and values
$flippedArray = array_flip($originalArray);

// Output the flipped array
print_r($flippedArray);
```

Output:
```
Array
(
    [red] => apple
    [yellow] => banana
    [purple] => grape
)