php remover o último carácter no texto
//Remove the last character using substr
$string = substr($string, 0, -1);
php remover o último carácter do texto
$hell = substr('hello', 0, -1);
php remover a última linha nova do texto
$string = rtrim($string_to_remove);
texto de php remover o último carácter
echo substr('a,b,c,d,e,', 0, -1);
# => 'a,b,c,d,e'
remover o último carácter do texto php
$newarraynama = rtrim($arraynama, ", ");