Get First N Characters of String using PHP July 8, 2021 PHP 0 Comments 396 Views substr function <?php $text = 'HelloWorld!'; $n = 5; $result = substr($text, 0, $n); echo $result.PHP_EOL; // Hello
Leave a Comment
Cancel reply