php cut off end of string code example
Example 1: get last character of string php
substr("testers", -1); // returns "s"
Example 2: php substr remove last 4 characters
echo substr($string, 0, -3);
substr("testers", -1); // returns "s"
echo substr($string, 0, -3);