function replaceUrls($str){if(empty($str)){return $str;}$regex = '/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/i';return preg_replace($regex,'<a href="$1">$1</a>',$str);}
参考链接:/lw5116/p/10872090.html
时间:2023-09-18 10:25:58
function replaceUrls($str){if(empty($str)){return $str;}$regex = '/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/i';return preg_replace($regex,'<a href="$1">$1</a>',$str);}
参考链接:/lw5116/p/10872090.html
php超链接到图片 php正则表达式提取网页超链接url与网页中图片
2023-05-12
s-sed替换或者修改文件指定行 同时匹配多个字符串 替换换行符为指定字符
2019-04-25