Sheldon
09-06-2007, 05:32 PM
Ok, I am havinf more issues with substr.
I have this
$te = addslashes("This is a long blurb of text that should span over two lines and it just seams to be repeating the first line.");
if(!empty($te)){
$text .= substr(stripslashes($te),0, 22)."\n";
echo(strlen(stripslashes($te)));
if(strlen(stripslashes($te) > 22)){
$text .= "<br />" . substr(stripslashes($te),23, 38);
}
if(strlen(stripslashes($te)) > 38){ $text .= $text ."..."; }
}
echo($text);
die;
All id does it return the first line 2 times and adds the three ... dots.
What am i doing wrong?
I have this
$te = addslashes("This is a long blurb of text that should span over two lines and it just seams to be repeating the first line.");
if(!empty($te)){
$text .= substr(stripslashes($te),0, 22)."\n";
echo(strlen(stripslashes($te)));
if(strlen(stripslashes($te) > 22)){
$text .= "<br />" . substr(stripslashes($te),23, 38);
}
if(strlen(stripslashes($te)) > 38){ $text .= $text ."..."; }
}
echo($text);
die;
All id does it return the first line 2 times and adds the three ... dots.
What am i doing wrong?