Welcome Guest, Not a member yet? Register   Sign In
Display Excerpt
#2

[eluser]Medikal[/eluser]
I used a custom function on mine to be honest:
Code:
function excerptString($string, $desLength, $endChars = '...', $before = '1', $offChar = ' ')
{
    if (strlen($string) < $desLength)
    {
        return $string;
    }

switch($before)
{
case 0:
$partialString = substr($string, $desLength, strlen($string));
$endPosition = strpos($partialString, $offChar);
return substr($string, 0, $desLength+$endPosition).$endChars;
break;

case 1:
$string = substr($string, 0, $desLength);
$endPosition = strrpos($string, $offChar);
return $string = substr($string, 0, $endPosition).$endChars;
break;

}

}

Further explanation of how to use it is here:
http://danlamanna.com/portfolio/?p=24


Messages In This Thread
Display Excerpt - by El Forum - 01-04-2011, 07:02 PM
Display Excerpt - by El Forum - 01-04-2011, 10:10 PM
Display Excerpt - by El Forum - 01-05-2011, 12:39 AM



Theme © iAndrew 2016 - Forum software by © MyBB