Remove Last N Characters from String using PHP July 7, 2021 PHP 0 Comments 249 Views substr function <?php $text = 'HelloWorld!'; $n = 6; $result = substr($text, 0, -$n); echo $result; // Hello
Leave a Comment
Cancel reply