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 email address will not be published. Required fields are marked *

+ sixty six = 76