PHPackages                             echron/tools - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. echron/tools

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

echron/tools
============

Tools library for PHP

1.8.1(10mo ago)113.6k12MITPHPPHP &gt;=8.2CI passing

Since Jun 14Pushed 10mo ago1 watchersCompare

[ Source](https://github.com/EchronHQ/Tools)[ Packagist](https://packagist.org/packages/echron/tools)[ Docs](https://github.com/EchronHQ/Tools)[ RSS](/packages/echron-tools/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (7)Dependencies (4)Versions (42)Used By (2)

Echron PHP Tool library
=======================

[](#echron-php-tool-library)

[![Unit Tests](https://github.com/EchronHQ/Tools/actions/workflows/php.yml/badge.svg)](https://github.com/EchronHQ/Tools/actions/workflows/php.yml)[![Latest Stable Version](https://camo.githubusercontent.com/dce1b9c017edde17b19a9243b95dcb342cb8fd62ae03d9d196d50c86f490202a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f656368726f6e2f746f6f6c732e737667)](https://packagist.org/packages/echron/tools)

About
-----

[](#about)

[Echron](https://echron.com) PHP Tool library offers a set of handy classes and methods to simplify PHP development.

Installation
------------

[](#installation)

Install the latest version with

```
composer require echron/tools
```

Usage
-----

[](#usage)

### Output seconds as human-readable string

[](#output-seconds-as-human-readable-string)

```
echo \Echron\Tools\Time::readableSeconds(60 * 24);
>> 24 minutes
echo \Echron\Tools\Time::readableSeconds(60 + 3.4221580028534);
>> 1 minute, 3.42 seconds
echo \Echron\Tools\Time::readableSeconds(3.455669555);
>> 3.46 seconds
```

### Check if array has duplicates

[](#check-if-array-has-duplicates)

```
$a = \Echron\Tools\ArrayHelper::hasDuplicates(['red', 'green', 'purple']);
print_r($a);
>> false

$b = \Echron\Tools\ArrayHelper::hasDuplicates(['red', 'green', 'purple','red]);
print_r($b);
>> true
```

### Filter array by unique values

[](#filter-array-by-unique-values)

```
$a = \Echron\Tools\ArrayHelper::unique(['red', 'green', 'purple'],['orange','red']);
print_r($a);
>> ['red','green','purple','orange']
```

### Limit a string without cutting of words

[](#limit-a-string-without-cutting-of-words)

```
$a = \Echron\Tools\StringHelper::limitWords('This is a basic string', 20);
print_r($a);
>> "This is a basic"
```

It is possible to pass along an end marker that will be added to the endof the string when the string is truncated. The end marker is included in the maximum character string, the result will not be longer than the maximum characters even when the end marker is added.

```
$result = \Echron\Tools\StringHelper::limitWords('This is a basic string', 20, ' ...');
print_r($result);
>> "This is a basic ..."
```

### Limit a string

[](#limit-a-string)

```
$result = \Echron\Tools\StringHelper::limit('This is a basic string', 20);
print_r($result);
>> "This is a basic stri"
```

Add an end marker

```
$result = \Echron\Tools\StringHelper::limit('This is a basic string', 20, ' ...');
print_r($result);
>> "This is a basic  ...', $result)"
```

### CSV

[](#csv)

- Read out CSV file into an array

```
$result = \Echron\Tools\CsvHelper::parseCSVFile('file.csv');
```

- Write a CSV file based on an array

```
$result = \Echron\Tools\CsvHelper::toCSVFile(['field'=> 'value'], 'file.csv');
```

###  Health Score

50

—

FairBetter than 96% of packages

Maintenance54

Moderate activity, may be stable

Popularity26

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity88

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~85 days

Recently: every ~2 days

Total

40

Last Release

307d ago

PHP version history (5 changes)1.0.0PHP &gt;=7.0.0

1.3.3PHP &gt;=7.0 || &gt;=8.0

1.4.0PHP &gt;=7.4 || &gt;=8.0

1.6.2PHP &gt;=8.1

1.8.0PHP &gt;=8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/9477f1195b4f7dcf4eaedfcbc4f3721a2b9e96a50400b6b168307587769381c2?d=identicon)[Echron](/maintainers/Echron)

---

Top Contributors

[![Echron](https://avatars.githubusercontent.com/u/2070180?v=4)](https://github.com/Echron "Echron (129 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/echron-tools/health.svg)

```
[![Health](https://phpackages.com/badges/echron-tools/health.svg)](https://phpackages.com/packages/echron-tools)
```

###  Alternatives

[panphp/pan

A simple, lightweight, and privacy-focused product analytics php package.

1.2k94.6k5](/packages/panphp-pan)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
