Get Last N Characters of String using PHP July 9, 2021 PHP 0 Comments 307 Views substr function <?php $text = 'HelloWorld!'; $n = 6; $result = substr($text, -$n); echo $result.PHP_EOL; // World!
Leave a Comment
Cancel reply