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