The tagId is different, but the tagName and tagType are the same. How can I delete the latter one. {Code...} The tagId is different, but the tagName and tagType are the same. How can I delete the latter one.
[17] => Array ([tagId] => 9677 [tagName] => [tagType] => 2) [18] => Array ([tagId] => 9678 [tagName] => [tagType] => 2)
Reply content:
The tagId is different, but the tagName and tagType are the same. How can I delete the latter one.
[17] => Array ([tagId] => 9677 [tagName] => [tagType] => 2) [18] => Array ([tagId] => 9678 [tagName] => [tagType] => 2)
php
$ Tags = array (Array ('tagid' => 9677, 'tagname' => 'antslice-slogs', 'tagtype' => 2 ,), array ('tagid' => 9678, 'tagname' => 'antelogisy', 'tagtype' => 2); assoc_unique ($ tags, 'tagname ', 'tagtype'); print_r ($ tags); function assoc_unique (& $ arr, $ key, $ key2) {$ res = array (); for ($ I = 0; $ I
Combine tagName and tagType as the key of a new array.
The method described above is the easiest! Link the tagName and tagType as the key of the new array, and the duplicate value is automatically filtered out.