我正在处理有很多重复的数组列表
我使用 array_unique
foreach ($aData as $test) {
preg_match( "~http://www.site.com/.*?/~", $test,$match) ;
$a[] = $match;
}
输出
Array (
[0] => Array ( [0] => */liars-all-2013-hdrip-xvid-s4a/ )
[1] => Array ( [0] => */liars-all-2013-hdrip-xvid-s4a/ )
[2] => Array ( )
[3] => Array ( [0] => */liars-all-2013-hdrip-xvid-s4a/ )
[4] => Array ( [0] => */mt-zion-2013-dvdrip-xvid-fihvid/ )
[5] => Array ( [0] => */mt-zion-2013-dvdrip-xvid-fihvid/ )
[6] => Array ( [0] => */mt-zion-2013-dvdrip-xvid-fihvid/ )
[7] => Array ( [0] => */the-ghastly-love-of-johnny-x-2012-webrip-xvid-fan0n/ )
[8] => Array ( [0] => */the-ghastly-love-of-johnny-x-2012-webrip-xvid-fan0n/ )
[9] => Array ( [0] => */the-ghastly-love-of-johnny-x-2012-webrip-xvid-fan0n/ )
[10] => Array ( [0] => */kung-fu-panda-good-croc-bad-croc-2013-dvdrip-x264-ac3-deep1007/ )
[11] => Array ( [0] => */kung-fu-panda-good-croc-bad-croc-2013-dvdrip-x264-ac3-deep1007/ )
[12] => Array ( [0] => */kung-fu-panda-good-croc-bad-croc-2013-dvdrip-x264-ac3-deep1007/ )
[13] => Array ( [0] => */a-viking-saga-the-darkest-day-2013-1080p-bluray-x264-ulshd/ )
[14] => Array ( [0] => */a-viking-saga-the-darkest-day-2013-1080p-bluray-x264-ulshd/ )
[15] => Array ( [0] => */a-viking-saga-the-darkest-day-2013-1080p-bluray-x264-ulshd/ )
[16] => Array ( [0] => */dead-man-down-2013-extras-720p-bluray-x264-phd/ )
[17] => Array ( [0] => */dead-man-down-2013-extras-720p-bluray-x264-phd/ )
[18] => Array ( [0] => */dead-man-down-2013-extras-720p-bluray-x264-phd/ )
[19] => Array ( [0] => */spider-baby-1968-720p-bluray-x264-geckos/ )
[20] => Array ( [0] => */spider-baby-1968-720p-bluray-x264-geckos/ )
[21] => Array ( [0] => */spider-baby-1968-720p-bluray-x264-geckos/ )
[22] => Array ( [0] => */drift-2013-bluray-720p-750mb-direct-download/ )
[23] => Array ( [0] => */drift-2013-bluray-720p-750mb-direct-download/ )
[24] => Array ( [0] => */drift-2013-bluray-720p-750mb-direct-download/)
[25] => Array ( [0] => */beautiful-creatures-2013-720p/ )
[26] => Array ( [0] => */beautiful-creatures-2013-720p/ )
[27] => Array ( [0] => */beautiful-creatures-2013-720p/ )
[28] => Array ( [0] => */death-race-3-inferno-2012-bluray-720p-direct-download/ )
[29] => Array ( [0] => */death-race-3-inferno-2012-bluray-720p-direct-download/ )
[30] => Array ( [0] => */death-race-3-inferno-2012-bluray-720p-direct-download/ )
)
看起来 array_unique 无法深入到数组中:[]**[x]**
所以我在 array_unique 之后得到的唯一东西是我的第一个 [0][string] 我试图只使用 $match 但它只显示最后一个无用的字符串
那么我该如何解决这个BUG呢?