PHPackages                             emersonbroga/social-counters - 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. [Image &amp; Media](/categories/media)
4. /
5. emersonbroga/social-counters

ActivePackage[Image &amp; Media](/categories/media)

emersonbroga/social-counters
============================

A Simple PHP class to convert numbers to social media counters from 1000 to 1K, 1000001 to 1M+.

1.0.0(8y ago)236MITPHPPHP &gt;=5.4

Since Nov 26Pushed 8y ago1 watchersCompare

[ Source](https://github.com/emersonbroga/social-counters)[ Packagist](https://packagist.org/packages/emersonbroga/social-counters)[ RSS](/packages/emersonbroga-social-counters/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

SocialCounters
==============

[](#socialcounters)

If you ever needed to display social media like counters on your website, but you need to format it as 1K intead of 1000 or 1M instead of 1000000 or something like 1.2M+ instead of 1234567, this is what you need.

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

[](#installation)

```
composer require emersonbroga/social-counters:dev-master

```

Then:

```
require 'vendor/autoload.php';

use  \EmersonBroga\SocialCounters;

$socialCounters = new SocialCounters();
echo $socialCounters->format(1234567); // 1.2M+

```

Customize
---------

[](#customize)

If you need different suffixes, you can customize it.

```
require 'vendor/autoload.php';

use  \EmersonBroga\SocialCounters;

$socialCounters = new SocialCounters();
$socialCounters->thousandSuffix = 'G';
echo $socialCounters->format(1234); // 1.2G+

```

The available suffixes are:

```
$socialCounters->$thousandSuffix = 'K';
$socialCounters->$millionSuffix = 'M';
$socialCounters->$billionSuffix = 'B';
$socialCounters->$trillionSuffix = 'T';

```

2017 - Emerson Carvalho.

Thanks ♥ 🐘

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

3085d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f35833afdcd9f99f5c3c9f24be03471796c5519acf5f56802eb6536712e1071c?d=identicon)[emersonbroga](/maintainers/emersonbroga)

---

Top Contributors

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

---

Tags

mediasocialnumberscounters

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/emersonbroga-social-counters/health.svg)

```
[![Health](https://phpackages.com/badges/emersonbroga-social-counters/health.svg)](https://phpackages.com/packages/emersonbroga-social-counters)
```

###  Alternatives

[essence/essence

Extracts information about medias on the web, like youtube videos, twitter statuses or blog articles.

770562.9k3](/packages/essence-essence)[s9e/text-formatter

Multi-purpose text formatting and markup library. Plugins offer support for BBCodes, Markdown, emoticons, HTML, embedding third-party media (YouTube, etc...), enhanced typography and more.

2413.1M29](/packages/s9e-text-formatter)[dereuromark/media-embed

A PHP library to deal with all those media services around, parsing their URLs and embedding their audio/video content in websites.

182530.3k11](/packages/dereuromark-media-embed)[yiimaker/yii2-social-share

Extension for sharing on social networks

48111.3k4](/packages/yiimaker-yii2-social-share)[cohensive/embed

Media Embed (for Laravel or as a standalone).

120370.4k](/packages/cohensive-embed)[classic-o/nova-media-library

Tool and field that will let you managing files and add them to the posts

154172.0k](/packages/classic-o-nova-media-library)

PHPackages © 2026

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