时间:2021-07-01 10:21:17 帮助过:24人阅读
$a = '123/frew/4214/fsdf/123/123/dsa'; $t = explode('/', $a); echo join('/', array_slice($t, 0, -2)) . '/';
------解决方案--------------------
$a= explode('/',$a);
$s[count($s)-1]试试
------解决方案--------------------
$b = join('/', array_slice($t, 0, -2)) . '/';
------解决方案--------------------
哎,6楼是开玩笑呢么?
$a = '123/frew/4214/fsdf/123/123/dsa';
$t = explode('/', $a);
$b=join('/', array_slice($t, 0, -2)) . '/';
echo $b;