I need to get the last character of a string.
Say I have “testers” as input string and I want the result to be “s”. how can I do that in PHP?
12 s
substr("testers", -1); // returns "s"
Or, for multibytes strings :
substr("multibyte string…", -1); // returns "…"