I am explaining you, how to remove duplicate values from Array in PHP. it is simple to delete duplicate values from an PHP Array.
PHP provide pre-define function array_unique that can remove duplicate values from Array. with the use of pre-define function array_unique() we can get only unique value from array.
Example:
<?php
$example_array = [10,3,12,10,23,54,78,64,75];
$example_array_updated = array_unique($example_array);
print_r($example_array_updated);
?>
Result:
Array
(
[0] => 10
[1] => 3
[2] => 12
[4] => 23
[5] => 54
[6] => 78
[7] => 64
[8] => 75
)
Hello, Welcome to webdeveloperindia.in. I am a full-stack web developer. Email – [email protected] | Skype – azaruddin23. I have knowledge of PHP, Laravel, Magento 1/2, Codeigniter, WordPress, Joomla, Shopify, Git, Bitbuket, jQuery, Ajax, Javascript and ReactJS.
this is very helpful i personaly used that great thanks for it…