delete last character in php string code example
Example 1: php remove last character in string
//Remove the last character using substr
$string = substr($string, 0, -1);
Example 2: javascript remove last character from string
var str = "Hello";
var newString = str.substring(0, str.length - 1); //newString = Hell
Example 3: php remove last character from string
$hell = substr('hello', 0, -1);