Don't want the line breaks to show so I wrote this code after reading the php-manual. But it's a chance that the count to 35 letters is inside of an other kind of tag (like the long SPAN-tag), and this is messing up my string and table that the string is printed out in... And I do want to show all the tags, exept for the line breaks.
// Don't show line breaks.
$to_replace = array('<p>', '<br>', '<br />');
$replace_with = array(' ', ' ', ' ');
$subnews = str_replace($to_replace, $replace_with, $rad['news']);
//Only show the first 35 letters and add '...'.
$subnews2 = substr($subnews,0,35) . '...';
print $subnews2;
I allso tryed to remove the long link-tags which solved some, but I DO NOT realy want to remove this kind of tags...
//Remove link tags.
$subnews2 = preg_replace(" (\<a.*?\>)", "", $subnews);
$subnews3 = preg_replace(" (\</a.*?\>)", "", $subnews2);