2
我试图隐藏从注册会员没有,BB代码的作品链接,并将其隐藏,但是HTML代码不起作用。隐藏链接在论坛
例如,
[link=http://www.brandbucket.com/]Brand Bucket[/link]
这隐藏很好。
在另一方面..
<a href="http://www.char5.com/" target="_blank">http://www.char5.com</a>
这并不能掩盖所有的超级链接工作正常。
这里是下面的任何帮助,请,谢谢代码。
$text = preg_replace("/\[file\=(.*?)\](.*?)\[\/file\]/is", $rep, $text);
$text = preg_replace("/\[link\=(.*?)\](.*?)\[\/link\]/is", $rep, $text);
$text = preg_replace("/\[url\=(.*?)\](.*?)\[\/url\]/is", $rep, $text);
$text = preg_replace("#(^|[\n ])([\w]+?://[^ \"\n\r\t<,]*)#is", "\\1".$rep, $text);
$text = preg_replace("#(^|[\n \]])((www|ftp)\.[\w+-]+?\.[\w+\-.]*(?(?=/)(/.+?(?=\s|,\s))|(?=\W)))#is", "\\1".$rep, $text);
没有任何一个正则表达式模式看起来像他们甚至试图匹配HTML锚点标记,但我不建议您尝试。可能值得你看看[DOMDocument](http://php.net/DomDocument)和XPath。 –