Today now in this post i will show you How to remove duplicate values from Array in PHP? This is very easy to delete the duplicate values from any PHP Array. But sometimes new developers are confuse about how to remove. But in PHP provide a pre-define function as array_unique that is help us to remove the duplicate values from Array.
By using array_unique() we can get only the unique value from array. So, now we can see in the bellow example i have one value two times but when i will use the array_unique() then it will return the only unique value as the bellow output:
$myArray = [11,34,56,78,34]; $myArrayNew = array_unique($myArray); print_r($myArrayNew);
Array (  => 11  => 34  => 56  => 78 )
Thanks for read. I hope it help you. For more you can follow us on facebook