phpCopy<?php $string = 'This is a string'; $lastChar = substr($string, -1); echo "The last char of the string is $lastChar."; ?>