php匹配url的正则表达式

2015-01-08 0 562
php匹配url的正则表达式
//https?://([-\w\.]+)+(:\d+)?(/([\w/_\.]*(\?\S+)?)?)?

//PHP Example: Automatically link URL's inside text.

$text = preg_replace('@(https?://([-\w\.]+)+(:\d+)?(/([\w/_\.]*(\?\S+)?)?)?)@', '<a href="$1">$1</a>', $text);

遇见资源网 php php匹配url的正则表达式 http://www.ox520.com/7154.html

常见问题

相关文章

发表评论
暂无评论
官方客服团队

为您解决烦忧 - 24小时在线 专业服务