Back to PhocaGalleryText class

Method wordDelete

public static
wordDelete
(mixed $string, mixed $length, mixed $end = '...')

Method wordDelete - Source code

public static function wordDelete($string, $length, $end = '...')
{
    if (StringHelper::strlen($string) < $length || StringHelper::strlen($string) == $length) {
        return $string;
    } else {
        return StringHelper::substr($string, 0, $length) . $end;
    }
}