Monday, 2 November 2015

unique array in php

array_unique
<?php
$input = array("a" => "green", "red", "b" => "green", "blue", "red");
$result = array_unique($input);
print_r($result);
?>



Array
(
    [a] => green
    [0] => red
    [1] => blue
)

No comments:

Post a Comment