phpCopy<?php $string = "This is a string"; $lengthOfString = strlen($string); $lastCharPosition = $lengthOfString-1; $lastChar = $string[$lastCharPosition]; echo "The last char of the string is $lastChar."; ?>