1. Define how many characters you want to display.
2. Find what is the last character displaying.
3. If the last character displaying is not " " (space) then go to next character until we found it.
4. Display your message.
############### Code
<?
$position=14;
$message="You are now joining over 2000 current";
$post = substr($message,$position,1);
if($post !=" "){
while($post !=" "){
$i=1;
$position=$position+$i;
$message="You are now joining over 2000 current";
$post = substr($message,$position,1);
}
}
$post = substr($message,0,$position);
echo $post;
echo "...";
?> |