php 截取字符串

去除掉最后面的01

$str = '中国-福建-厦门-湖里-01';
echo str_replace(strrchr($str, "-"), '', $str);

posted @ 2019-03-15 09:33  pengcx  阅读(184)  评论(0编辑  收藏  举报