Home  >  Article  >  Backend Development  >  求解,正则表达式好手

求解,正则表达式好手

WBOY
WBOYOriginal
2016-06-13 11:20:58978browse

求解,正则表达式高手~
eg,我的链接原本是$url=http://www.baidu.com.cn/edms/ed33

我现在想用php的正则表达式匹配后,把前缀去掉,变成

$url=baidu.com.cn/edms/ed33

正则表达式应该怎么写?


------解决方案--------------------
echo preg_replace('#https?://www\.#','',$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
Previous article:nginx停的重定向配置Next article:php jpgraph是什么?