php过滤html中的其他网站链接的方法(域名白名单功能)
复制代码 代码如下:/** * 过滤外站链接 * @param array $local_domain 本站域名 数组 * @param string $message 文本内容 */ function replace_outer_links($local_domain_arr, $message) { $pattern= "/<[^>]*href=[""]http[s]?://(?!" ; $i = 0 ; foreach ($...