Code: Select all
$content = "Hello world <p> with more than 25 characters";
$content = substr("$content", 0, 25);
echo"$content";However....
If my first 25 characters are the first part of a peice of html code.... like....
Code: Select all
$content = "<img src='img.gif' alt='really long alt text' title='really long title text' />";
$content = substr("$content", 0, 25);
echo"$content";