Sean <picasso@madflower.com> writes: > $one_char = substr ($string -1, 1); That doesn't take off the last character. It subtracts 1 from $string and drops the first character. You probably meant to include another `,': $last_char = substr ($string, -1, 1); although you can also leave off the last argument in this case: $last_char = substr ($string, -1);