Posted By

a1ias on 12/30/14


Tagged

php array duplicates


Versions (?)

Remove duplicates from multi-dimensional array 2


 / Published in: PHP
 

Works with any array

  1. foreach ($tmp as $k => $v) {
  2. if (strpos(serialize($result),$v['id']) === FALSE) {
  3. $result[] = $v;
  4. }
  5. }

Report this snippet  

You need to login to post a comment.