Array_unique is a method in PHP which is used to display unique elements in an Array. It removes duplicate elements. The method takes the array as an Input and returns an array that contains only unique values.
Keep in mind that the array will not re- position the elements after it removes duplicates.
In this array, $arr =1 , $arr=2, $arr=2, $arr=3
Then, if we apply the method to this array.
We get an array which has elements-
$arr=1, $arr=2 and $arr =3;
There will be a null element at index 2, since that element was removed. So the element which was at index 3, will still remain at 3 and it would not re position itself to index 2.