url="http://www.baidu.com/news/26/2/202112/t20211226_5794454.html";
preg_match
-----------------------------------------------------
**网友回复**:
不是这样就行了么:https?://www.baidu.com/.+/
网友回复:
引用:G.K.D发表于2021-12-2614:27
不是这样就行了么:
原始文本:
匹配结果:
网友回复:
引用:榆木发表于2021-12-2614:26
还不如直接从右边以/切割
网友回复:
implode(/,array_splice(explode(/,http://www.baidu.com/news/26/2/202112/t20211226_5794454.html),0,-1))./;
网友回复:
引用:电脑发表于2021-12-2614:35
网友回复:
引用:zxjlhsq发表于2021-12-2614:37
感谢没有上面兄弟的简洁