Home >Backend Development >PHP Tutorial >如何取出一段字符串中的链接

如何取出一段字符串中的链接

WBOY
WBOYOriginal
2016-06-13 11:40:421313browse

求助:怎么取出一段字符串中的链接
把下面一段字符串中的href地址取出来:

<a href="www.1.com" target="_blank">文章标题</a><br /><a href="www.2.com" target="_blank">1-1</a> <a href="www.3.com" target="_blank">1-2</a> <a href="www.4.com" target="_blank">1-3</a>

需要得到这样的格式:
<i>www.1.com</i><i>www.2.com</i><i>www.3.com</i><i>www.4.com</i>

谢谢!

Statement:
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