我有这样的表达:
$content = preg_replace('@(https?://([-\w\.]+)+(:\d+)?(/([\w/_\.]*(\?\S+)?)?)?)@', '<a href="$1" target="_blank">$1</a>', $content);而是像这样的链接
http://photoartkalmar.com/Photoart%20Kalmar%20high%20res/Gigapixel/Vienna%2050%20Gigapixel/Donauturm.html或者以something.jpg结尾
锚链接止于%或。在urls上,所以它不会使它全部成为一个链接,只有一半。我该如何解决这个问题呢?
发布于 2010-11-12 05:50:40
当然,将%符号放在正则表达式中的正确位置:[\w/_\.] [\w/_\.%]→
看看这一整行代码,看看具体在哪里:
$content = preg_replace('@(https?://([-\w\.]+)+(:\d+)?(/([\w/_\.%]*(\?\S+)?)?)?)@', '<a href="$1" target="_blank">$1</a>', $content);https://stackoverflow.com/questions/4159507
复制相似问题