rimuovi ultima lettera php
<?php
echo substr('abcdef',0, -1); // abcde
?>
php rimuove l'ultimo carattere dalla stringa
$hell = substr('hello', 0, -1);
php substr rimuovere ultimi 4 caratteri
echo substr($string, 0, -3);
rimuovere l'ultimo carattere dalla stringa in php
$arrStr = 'Str1, Str2, str3, ';
echo rtrim($arrStr, ", "); //Str1, Str2, str3
echo substr_replace($arrStr, "", -2); //Str1, Str2, str3
echo substr($arrStr, 0, -2); // Str1, Str2, str3
php rimuove l'ultimo carattere dalla stringa
//Remove the last character using substr
$string = substr($string, 0, -1);
php rimuove l'ultimo carattere dalla stringa se virgola
$string = rtrim($string, ',');