以数字开头的重复数据如:
复制代码 代码如下:
Array (
[0] => 100
[k1] => 100
[1] => 2123
[k2] => 2123 )
该方法可以将以数字为key的值去掉,先将数组按照key倒序排序,然后用array_unique的方法将重复的值去掉。
不能适用于下面的情况:不同的key值存在相同的value的情况
复制代码 代码如下:
function array_unique_value($arr = array()){
array_multisort($arr, SORT_DESC, array_keys($arr));
print_r(array_unique($arr));
}

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Dreamweaver CS6
Visual web development tools

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

Dreamweaver Mac version
Visual web development tools

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.