Hello,
I want to print only 8 characters then after print three dots using string functions
So please help me
Thanks And Regards
swamy
only print 8 characters
Moderator: General Moderators
Re: only print 8 characters
Code: Select all
<?php
$originalString = 'Hello World!';
$newString = substr($originalString, 0, 8) . '…';
//output is Hello Wo...
echo $newString;
?>
Last edited by Kadanis on Tue Oct 14, 2008 11:13 am, edited 1 time in total.
Re: only print 8 characters
Instead of ... as dots you really ought to be using …