What is the potential issue with duplicate outputs in a foreach loop in PHP?

The potential issue with duplicate outputs in a foreach loop in PHP is that if the array being iterated over contains duplicate values, those values may be output multiple times. To solve this issue, you can use the `array_unique()` function to remove duplicate values from the array before iterating over it in the foreach loop.

// Example array with duplicate values
$array = [1, 2, 2, 3, 4, 4, 5];

// Remove duplicate values from the array
$uniqueArray = array_unique($array);

// Iterate over the unique array
foreach ($uniqueArray as $value) {
    echo $value . "<br>";
}