php正则表达式匹配出想要的结果
其他问答
1
如何写才能把
第一集#https://iqiyi.cdn9-okzy.com/20201104/43645634255.html
第二集#https://iqiyi.cdn9-okzy.com/20201104/75676457567.html
正则匹配出#的前后生成
<a src="https://iqiyi.cdn9-okzy.com/20201104/43645634255.html">第一集</a>
<a src="https://iqiyi.cdn9-okzy.com/20201104/75676457567.html">第二集</a>
类似
$content = preg_replace("第一集#https://iqiyi.cdn9-okzy.com/20201104/43645634255.html", '<a src="$1">$2</a>\n', $content);
昨天试了一天没成功
-
$content="第一集#https://iqiyi.cdn9-okzy.com/20201104/43645634255.html 第二集#https://iqiyi.cdn9-okzy.com/20201104/75676457567.html"; echo $content = preg_replace("/(.*?)\#(.*?)/iU", '<a src="$2">$1</a><br>', $content);
-
$content= "第一集#https://iqiyi.cdn9-okzy.com/20201104/43645634255.html" $content = preg_replace("(.*)#(.*)","<a src='$2'>$1</a><br>",$content);
发表回复