array_unique

It removes duplicate values from an array
Example

<?php
echo “<pre>”;
$array1 = array(“a” => “PHP”, “PHP”, “b” => “ASP”, “ASP”, “JSP”);
print_r(array_unique($array1));
?>

Output

Array
(
[a] => PHP
[b] => ASP
[2] => JSP
)

Share