帮忙写一个正则,替换超连接。多谢

WBOY
Release: 2016-06-13 11:33:17
Original
779 people have browsed it

帮忙写一个正则,替换超连接。谢谢!
我想替换超连接中的 http://www.baidu.com 变为 http://google.com/?url=http://www.baidu.com

现在找到一代码可以替换,但是不知道先怎么取出 http://www.baidu.com 然后加上 http://google.com/?url= 然后替换回去,变为 http://google.com/?url=http://www.baidu.com
的效果。

$str = '点击观看棋谱';    echo preg_replace("/(?]*)(?=\>)/i","#", $str); 



能帮写一个替换正则吗! 
替换字符串中所有的超级连接

谢谢了啊

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template