PHP Remova o último caractere em string
//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
?>
$hell = substr('hello', 0, -1);
$string = rtrim($string, ',');
echo substr($string, 0, -3);
$newarraynama = rtrim($arraynama, ", ");