请登录后探索更多精彩内容!
如果有两个以上相似的用户名 :admin 跟 admi 同时被@admin@admi@admin@admi @admin@admi 会出现匹配混乱
str_replace()函数里的$haya_post_info_usernames[0][$i]循环一次就替换$post['message']所有的@admin@admi 多次循环导致混乱
添加修改一下代码就好了
preg_match_all('/(?<=@).*?(,|,|:)/', $post['message_fmt'], $haya_post_info_usernames_fmts); preg_match_all('/(?<=@).*?(,|,|:)/', $post['message'], $haya_post_info_usernames);
暂无评论
暂无评论