Wednesday, February 22, 2012

How to get last character in String?

$str = 'This is still a test.';
$last = $str[strlen($str)-1];

No comments:

Post a Comment