代码片段: $face_filter = config('terminal.face_filter'); $filterArr = explode(',',$face_filter); foreach ($result['orderGoods'] as $key=>$val){ $badword = array_combine($filterArr,array_fill(0,count($filterArr),'***')); $detail = strtr($val['detail'], $badword); $result['orderGoods'][$key]['detail'] = !empty($detail) ? $detail : $val['detail']; }
过滤字符敏感字
最新推荐文章于 2024-10-01 18:22:37 发布