How to remove duplicate values from an array in PHP

后端 未结 24 1496
故里飘歌
故里飘歌 2020-11-22 03:40

How can I remove duplicate values from an array in PHP?

24条回答
  •  [愿得一人]
    2020-11-22 04:06

    If you concern in performance and have simple array, use:

    array_keys(array_flip($array));
    

    It's many times faster than array_unique.

提交回复
热议问题