PHP array_unique() Function

Complete PHP Array Reference

Definition and Usage

The array_unique() function removes duplicate values from an array. If two or more array values are the same, the first appearance will be kept and the other will be removed.



Parameter Description
array Required. Specifying an array

Tips and Notes

Note: The returned array will keep the first array item's key type.



The output of the code above will be:

Array ( [a] => Cat [b] => Dog )

Complete PHP Array Reference
Have Any Suggestion? We Are Waiting To Hear from YOU!

Your Query was successfully sent!