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?
Use substr() with a negative number for the 2nd argument.$newstring = substr($string1, -1);
$newstring = substr($string1, -1);