App\Libraries\Str::tail PHP Метод

tail() публичный статический Метод

The end (tail) of a string will be returned with an ellipsis before it where the text is cut.
public static tail ( $value, integer $limit = 100, string $start = '...' ) : string
$value
$limit integer
$start string
Результат string
    public static function tail($value, $limit = 100, $start = '...')
    {
        $value_len = strlen($value);
        $start_len = strlen($start);
        if ($limit >= $value_len) {
            return $value;
        } else {
            $tail_start = $value_len - $limit + $start_len;
        }
        return $start . substr($value, $tail_start);
    }