Hello Readers!
On a given string if you want to take out the first n number of characters from it then PHP offers you 'substr' to get the characters.
Consider an example below:-
Suppose I want to get the first 5 characters from string, $MyString
$MyString = 'Im printing first 5 characters';
I use the line below
$GetString = substr($MyString,0,10).'...'`
echo $GetSting;
Output:-
Im printing p
0 Comment(s)