How to remove duplicate values from an array in PHP

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

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

24条回答
  •  无人及你
    2020-11-22 04:00

    explode(",", implode(",", array_unique(explode(",", $YOUR_ARRAY))));

    This will take care of key associations and serialize the keys for the resulting new array :-)

提交回复
热议问题