Dee*_*pak 1 php arrays duplicates array-unique
我想从php中删除数组中的重复元素.以下是数组的结构
Array
(
[0] => Array
(
[0] => xllga@hotmail.com
[1] => bounce@abc.com
[2] => 20120416135504.21734.qmail@abc.com
[3] => xllga@hotmail.com
[4] => info@abc.com
[5] => info@abc.com
[6] => xllga@hotmail.com
[7] => xllga@hotmail.com
)
)
Run Code Online (Sandbox Code Playgroud)
怎么去呢?
试试array_unique.
代码:
<?php
$arr = array_unique($arr);
?>
Run Code Online (Sandbox Code Playgroud)
array array_unique(array $ array [,int $ sort_flags = SORT_STRING])
获取输入数组并返回没有重复值的新数组.