作者热门文章
- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我想用 php
检测像 $string
这样的字符串是否包含重复的尾部斜杠。
例如:
$string = "http://somepage.com/something/some.html/////";
到
$string = "http://somepage.com/something/some.html";
我想做一个if
,如果它有重复,像这样:
If ($string = "http://somepage.com/something/some.html/////";) {
remove extra trailing slashes
}
//else do nothing...
最佳答案
申请rtrim
像这样
$string = rtrim($string, '/');
关于php - 删除重复的尾部斜杠,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13990256/
我是一名优秀的程序员,十分优秀!