PHP array_unique: Remove Array Duplicates

You can utilize the array_unique() function in PHP to remove duplicate elements from an array. The method is as follows:

$originalArray = array("a", "b", "a", "c", "b");
$uniqueArray = array_unique($originalArray);

print_r($uniqueArray);

The code above will output an array with duplicates removed:

Array
(
    [0] => a
    [1] => b
    [3] => c
)
bannerAds