Hi,
I know how to limit the number of characters using substr,
(http://uk.php.net/manual/en/function.substr.php).
But when using html that is not going to work because of all the possible
tags, (anchor, image, table...etc).
for example, if I have some text...
$text = "<a href='somelonnnnnnngg'>this is a small text</a>";
I want to create a function to make sure that there is not more than 10
chars displayed.
but if I use
$text1 = substr($text, 0,10 );
i get $text1= "<a href='s";
where I would like to get
$text = "<a href='somelonnnnnnngg'>this is a </a>";
^^ only 10
chars.
How could the above be achieved?
Many thanks.
Sims