Home > Backend Development > PHP Tutorial > 求解,正则表达式高手~

求解,正则表达式高手~

WBOY
Release: 2016-06-23 14:05:43
Original
817 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);

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