2010-03-27 138 views
0

你好,這是我的數組,我需要刪除重複值,請hekp我出去從多維數組中刪除在PHP重複值

Array ([0] => Array ([0] => 

    * garfield calicut 
     Address: tanil nadu chennai0696955666 
     About Company: re stored. 


[1] => 0.0004 [2] => 0) [1] => Array ([0] => 

    * gamut 
     Address: ashok puram calicut9865326921 
     About Company: You've come. 


    * garfield calicut 
     Address: tanil nadu chennai0696955666 
     About Company: re stored. 


    * Hyva It Solutions 
     Address: 697/75,30th Cross 
     About Company: Hyva IT Solutions. 


    * streem pvt Ltd 
     Address: onden road kannur9845672062 
     About Company: Go to the website 


    * Advanced It Wave 
     Address: Ayyappankavu, Ernakulam (North), 
     About Company: Website Developement Services 


    * Viral Industry 
     Address: vettiyar, kodam p o tramp8469666663 
     About Company: # for discussion 

[1] => 0.0008 [2] => 0) [2] => Array ([0] => company [1] => 0.0007 [2] => 1)) 

這裏「加菲貓卡利卡特 地址:tanil德邦chennai0696955666 關於公司:重新存儲。 ' 是重複的,我需要顯示只有一次

+2

筒陣列[X] [0]始終/任何地方包含一個_或more_地址作爲一個字符串? (爲什麼他們不被分解成單獨的元素?)你必須識別/刪除每一個可能的重複? – VolkerK 2010-03-27 08:50:43

+1

你能解釋一下你的數組結構是怎樣的嗎?你的例子沒有說清楚我認爲。 – 2010-03-27 20:21:09

回答

0

如果你壓扁的數組只包含addreses一個數組,你總是可以使用

$addresses = array("street a', 'street b', 'street a'); // 3 elements 
$addresses = array_unique($addresses); // remove duplicates