PHP Удалить последний символ в строке
//Remove the last character using substr
$string = substr($string, 0, -1);
Kasmin Nicko
//Remove the last character using substr
$string = substr($string, 0, -1);
<?php
echo substr('abcdef',0, -1); // abcde
?>
<?php
$string = "hello world";
// create a substring starting 1 character from
// the beginning and ending 1 character from the end
$trimmed = substr($string, 1, -1);
echo $trimmed; // prints "ello worl"
$hell = substr('hello', 0, -1);
echo substr($string, 0, -3);
echo substr($string, 0, -3);