Algorithms for advice, experts come in to help solve the solution
Source: Internet
Author: User
Algorithms for advice, experts come in to help
There is an array $array[$i], if there is such a value 1,1,2,2,2,3,3,3,3,4,5,5,1,5 ...
I want to classify it, repeat it, and the final result 1,2,3,4,5 ...
What should we do?
Array_unique--Removes duplicate values from the divisor group
Description
Array array_unique (array array)
Array_unique () accepts the array as input and returns a new array with no duplicate values.
Note The key name remains unchanged. Array_unique () Sorts the values first as a string, then retains only the first key name encountered for each value, and then ignores all subsequent key names. This does not mean that the key name of the first occurrence of the same value in an unordered array is preserved.
Note: When and only if (string) $elem 1 = = = (string) $elem 2 o'clock two units are considered identical. That is, when the expression of a string is the same.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.