Unitrai

Removes duplicate values from an array in PHP

5 June 2020

array_unique function is helpful for this operation. USAGE: $arr = array("o" => "one", "two", "c" => "one", "one", "three"); print_r($arr); // array with duplicate values; $arr_unique = array_unique($arr); // do the magic print_r($result); // array with unique values;

array_unique function is helpful for this operation. USAGE:
$arr = array("o" => "one", "two", "c" => "one", "one", "three");
print_r($arr); // array with duplicate values;

$arr_unique = array_unique($arr); // do the magic
print_r($result); // array with unique values;

#Web

Share this post