darryncooke
Technical User
This is a script I found online and it works for static text but not for text that I am trying to pull from a dbase.
<?
$position=8; // Define how many characters you want to display.
$message=echo $row_articles_select['title'];
$post = substr($message,$position,1); // Find what is the last character displaying. We find it by getting only last one character from your display message.
if($post !=" "){ // In this step, if last character is not " "(space) do this step .
// Find until we found that last character is " "(space)
// by $position+1 (14+1=15, 15+1=16 until we found " "(space) that mean character 20)
while($post !=" "){
$i=1;
$position=$position+$i;
$message=echo $row_articles_select['title'];
$post = substr($message,$position,1);
}
}
$post = substr($message,0,$position); // Display your message
echo $post;
echo "...";
?>
Any idea why it isnt working?
Darryn Cooke
| The New Orange County Graphic designer and Marketing and Advertising Consultant
| Marketing and Advertising blog
<?
$position=8; // Define how many characters you want to display.
$message=echo $row_articles_select['title'];
$post = substr($message,$position,1); // Find what is the last character displaying. We find it by getting only last one character from your display message.
if($post !=" "){ // In this step, if last character is not " "(space) do this step .
// Find until we found that last character is " "(space)
// by $position+1 (14+1=15, 15+1=16 until we found " "(space) that mean character 20)
while($post !=" "){
$i=1;
$position=$position+$i;
$message=echo $row_articles_select['title'];
$post = substr($message,$position,1);
}
}
$post = substr($message,0,$position); // Display your message
echo $post;
echo "...";
?>
Any idea why it isnt working?
Darryn Cooke
| The New Orange County Graphic designer and Marketing and Advertising Consultant
| Marketing and Advertising blog