🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
## 逗号分割的字符串去重 ``` <?php //逗号分割的字符串转换成数组,去重后,转换回以逗号分割的字符串 $strs = '1,2,3,4,5,1,5,1,6,7,1,3,7'; $strs = implode(',',array_unique(explode(',',$strs))); echo $strs;//输出为1,2,3,4,5,6,7 ```