php check if last character in string is x code example Example: get last character of string php substr("testers", -1); // returns "s"