Hi guys,
I need help in limiting the amount of text on a page and create automated "continued" link, but everytime when I click on "continue" link, page must show rest of the text untill the whole text end.
so far, I've managed to cutoff the text but couldn't create automated continued link...
I'd really appreciate if anyone could lend me a hand on this one..
TIA
<?php
//here mysql grabs the story.. and assign them properly!
//the function
function Limit_Words($string, $length, $ellipsis = "...")
{
$words = explode(' ', $string);
$curindex = 0;
$wcount = 0;
foreach($words as $value){
$wcount += strlen($value)+1;
if($wcount>$length-strlen($ellipsis)){
break;
}
$curindex++;
}
return implode(' ', array_slice($words, 0, $curindex)) . $ellipsis;
}
//cutoff...
$LongStoryX = $LongStory;
$LongStory = Limit_Words($LongStory, 1500);
echo $LongStory;
echo '<br><br>';
//I couldn't do the "Continued" link
//Don't really know how to go from here..
if(strlen($LongStoryX) > strlen($LongStory))
{
?>
<tr>
<td height="19"></td>
<td align="left" valign="middle"><font size="2" color="#517aff"><b><a href="??">Continue</a></b></font> </td>
<td colspan="3" align="left" valign="middle"><img src="images/right.gif"></td>
</tr>
<?php
}
?>