Issue
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?
Solution
substr("testers", -1); // returns "s"
Or, for multibyte strings :
mb_substr("multibyte string…", -1); // returns "…"
Answered By - Rich Adams Answer Checked By - David Marino (PHPFixing Volunteer)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.