hello friends,
i have developed a php script which displays the news on the page. Even i have created the Read more link for the all those news. The problem is I want to display the whole sentence than the Read more links should appear.
if news contain information like 0.5 than it will stop at 0.
Example
The meeting is at 5.45. [read more]
than it will take
The meeting is at 5. [read more]
$length=strlen($row['newstext']);
if($length>370)
{
for ($posstr = 0; $posstr < 370; $posstr += strcspn($row["newstext"], "!.?", $posstr) + 1);
echo ' <span class="event" id="news">'.substr($row['newstext'],0,$posstr).'
... <a href="../news.php?newsid='.$row['newsid'].'" class="read">[read more...]</a></span>';
}
else
{
echo ' <span class="event" id="news">'.$row['news_text'].'
</span>';
}