时间:2021-07-01 10:21:17 帮助过:3人阅读
$str = "aaa
bbb
ccc
ddd
";
echo substr($str, 0, -5);
如果用查找的方式呢?查找到最后一个
后删除
$str = "aaa
bbb
ccc
ddd
";
echo substr($str, 0, -5);
$str = "aaa
bbb
ccc
ddd
";
echo substr($str, 0, -5); 我想找个跟chop类似的函数,只不过chop只能去除空格或预定义的
$str = "aaa
bbb
ccc
ddd
___";echo strrev(join('', explode('>/rb<', strrev($str), 2)));
rtrim($str,"
");
chop不就是rtrim么?