How can I remove repeated items in a two-dimensional array? I have an array. the var_dump value is array (1) {[0] & gt; array (3) {[0] & gt; string (0) & quot; [1] & gt; string (4) & quot; Gumu & quot; [2] & gt; string (0) & quot; & quot ;}} how can I remove repeated items in a two-dimensional array added to this array?
I have an array. The value of var_dump is:
Array (1) {[0] => array (3) {[0] => string (0) "" [1] => string (4) "Gumu" [2] => string (0 )""}}
Now we want to add value to this array: $ info [] = $ insert;
After adding the item, I want to remove the repeated items and do not want two identical items.
I use array_unique ($ info). how can I remove duplicates?
That is, if there is another item {"", "Gumu ",""}
It can be determined when one or more items are added.
------ Solution --------------------
PHP code
Function array_multiunique ($ ar) {$ t = array_map ('serialize', $ ar); $ t = array_unique ($ t); return array_map ('unserialize ', $ t) ;}$ ar = array ("", "Gumu", ""), array ("", "Gumu ",""),); print_r (array_multiunique ($ ar ));