Function Array Unique


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <?php
  2. function super_unique($array)
  3. {
  4. $result = array_map("unserialize", array_unique(array_map("serialize", $array)));
  5.  
  6. foreach ($result as $key => $value)
  7. {
  8. if ( is_array($value) )
  9. {
  10. $result[$key] = super_unique($value);
  11. }
  12. }
  13.  
  14. return $result;
  15. }
  16. ?>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.