Duplicate data starting with a number such as:
Copy CodeThe code is as follows:
Array (
[0] = 100
[K1] = 100
[1] = 2123
[K2] = 2123)
This method can take the value of the number key to remove, the array is sorted by the key in reverse order, and then use the Array_unique method to remove the duplicate value.
cannot be applied to situations where the same value exists for different key values
Copy the Code code as follows:
function Array_unique_value ($arr = Array ()) {
Array_multisort ($arr, Sort_desc, Array_keys ($arr));
Print_r (Array_unique ($arr));
}
http://www.bkjia.com/PHPjc/736858.html www.bkjia.com true http://www.bkjia.com/PHPjc/736858.html techarticle duplicate data starting with a number such as: The copy Code code is as follows: Array ([0] = [K1] = [1] = 2123 [K2] = 2123) The method can be the value of the key is removed, the array in accordance with the first ...