Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

how to remove duplicate values from an array in php

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

Array
(
    [a] => green
    [0] => red
    [1] => blue
)
 
PREVIOUS NEXT
Tagged: #remove #duplicate #values #array #php
ADD COMMENT
Topic
Name
8+2 =