2017 © Pedro PelĂĄez
 

library shorten

Provides truncation functions.

image

marcgoertz/shorten

Provides truncation functions.

  • Wednesday, April 19, 2017
  • by Dreamseer
  • Repository
  • 1 Watchers
  • 5 Stars
  • 31 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

Shorten

Provides additional truncation functions in PHP., (*1)

Test Coverage Status Packagist PHP Version Support Packagist Downloads Packagist Stars MIT License, (*2)

Installation

I recommend using Composer for installing and using Shorten:, (*3)

composer require marcgoertz/shorten

Of course you can also just require it in your scripts directly., (*4)

Usage

truncateMarkup('Go to example site', 10);
?>

Output:, (*5)

<a href="https://example.com/">Go to exam</a>


Functions

truncateMarkup(
    string $markup,
    int $length = 400,
    string $appendix = '
',
    bool $appendixInside = false,
    bool $wordsafe = false
): string
  • String $markup: Text containing markup
  • Integer $length: Maximum length of truncated text (default: 400)
  • String $appendix: Text added after truncated text (default: '
')
  • Boolean $appendixInside: Add appendix to last content in tags, increases $length by 1 (default: false)
  • Boolean $wordsafe: Wordsafe truncation (default: false)
  • String $delimiter: Delimiter for wordsafe truncation (default: ' ')

License

MIT © Marc Görtz, (*6)

The Versions

19/04 2017

dev-master

9999999-dev https://github.com/Dreamseer/php-shorten

Provides truncation functions.

  Sources   Download

MIT

markup shorten truncation

08/06 2016

dev-develop

dev-develop https://github.com/Dreamseer/php-shorten

Provides truncation functions.

  Sources   Download

MIT

markup shorten truncation

08/06 2016

2.1.0

2.1.0.0 https://github.com/Dreamseer/php-shorten

Provides truncation functions.

  Sources   Download

MIT

markup shorten truncation

08/06 2016

2.0.0

2.0.0.0 https://github.com/Dreamseer/php-shorten

Provides truncation functions.

  Sources   Download

MIT

markup shorten truncation

02/05 2015

1.3.0

1.3.0.0 https://github.com/Dreamseer/php-shorten

Provides truncation functions.

  Sources   Download

MIT

markup shorten truncation