求解,正则表达式好手

WBOY
Release: 2016-06-13 11:20:58
Original
976 people have browsed it

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

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

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

正则表达式应该怎么写?


------解决方案--------------------
echo preg_replace('#https?://www\.#','',$url);
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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!