Explore Yourself !!!


Return full string (without broken last word)

This function will return you substring of any number of characters without broken last word. Very useful function and easy to extend as you need.

function StringWithFullWords($MainString,$NoOrCharecter=10)
{
$Tmp=str_split($MainString,1);
for($I=0;$I$NoOrCharecter)
break;
if($Tmp[$I]==” “)
$LastSpacePos=$I;
}
return substr($MainString,0,$LastSpacePos);
}


No Comments Yet so far
Leave a comment



Leave a comment
Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>