Home  >  Article  >  Backend Development  >  求一段因特网址提取的正则

求一段因特网址提取的正则

WBOY
WBOYOriginal
2016-06-13 13:16:301056browse

求一段网址提取的正则
从一段字符串中提取网址

$str="www.taobao.com 求一段因特网址提取的正则 http://www.taobao.com"

把上面的网址全部提取出来的正则(只提取网址,不提取图片)
因为我要将提取出来的网址进行处理,所以请用preg_replace函数.

------解决方案--------------------
$str =www.taobao.com 求一段因特网址提取的正则 http://www.taobao.com
TXT;

echo preg_replace('/(?
print_r($url);

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