How to remove duplicate values from an array in PHP October 13, 2022 by Tarik Use array_unique(). Example: $array = array(1, 2, 2, 3); $array = array_unique($array); // Array is now (1, 2, 3)