添加供应内容过滤手机号,注意只能过滤手机号(其他模块也是一样的操作)
在module/sell.class.php
//这里是新发布信息 function add($post) { global $MOD; $post = $this->set($post); 下面加一行 $post['content'] = preg_replace("/1([0-9]{10})/", "", $post['content']); //过滤手机号 //这里是修改信息 function edit($post) { $this->delete($this->itemid, false); $post = $this->set($post); 下面加一行 $post['content'] = preg_replace("/1([0-9]{10})/", "", $post['content']); //过滤手机号
如果要过滤所有的数字就是
$post['content'] = preg_replace("/:([0-9]{6}),/", "***", $post['content']);
2022-11-30171℃
2024-02-0548℃
2023-04-2036℃
2020-12-1129℃
2023-04-0821℃
2023-03-1818℃
2023-12-1415℃
2023-03-2614℃
2023-04-1913℃