How to remove duplicate values from an array in PHP

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

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

24条回答
  •  北海茫月
    2020-11-22 03:58

    $arrDuplicate = array ("","",1,3,"",5);
     foreach(array_unique($arrDuplicate) as $v){
      if($v != "" ){$arrRemoved = $v;  }}
    print_r($arrRemoved);
    

提交回复
热议问题