My PHP script is returning some array and I would like to remove duplicates in that array. Can you please tell me how? I dont want to remove duplicates from MySQL, just from PHP
try this function http://php.net/manual/en/function.array-unique.php
array array_unique ( array $array [, int $sort_flags = SORT_STRING ] )
Exemple from the php.net documentation :
"green", "red", "b" => "green", "blue", "red"); $result = array_unique($input); print_r($result); ?>