Use the SUBSTR command:

$strWithoutLastChar = substr("abcdef", 0, -1);

This will return “abcde”

How to remove a trailing character in a string using PHP

Leave a Reply

Your e-mail address will not be published. Required fields are marked *

− two = five