php remove last line of string code example
Example 1: php remove last character from string
$hell = substr('hello', 0, -1);
Example 2: php remove last character from string if comma
$string = rtrim($string, ',');
$hell = substr('hello', 0, -1);
$string = rtrim($string, ',');