2017 © Pedro Peláez
 

package social-counters

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

image

emersonbroga/social-counters

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

  • Sunday, November 26, 2017
  • by emersonbroga
  • Repository
  • 1 Watchers
  • 1 Stars
  • 6 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 100 % Grown

The README.md

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., (*1)

Installation

composer require emersonbroga/social-counters:dev-master

Then:, (*2)

require 'vendor/autoload.php';


use  \EmersonBroga\SocialCounters;

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

Customize

If you need different suffixes, you can customize it., (*3)

require 'vendor/autoload.php';


use  \EmersonBroga\SocialCounters;

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

The available suffixes are:, (*4)

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

2017 - Emerson Carvalho., (*5)

Thanks ♥ 🐘, (*6)

The Versions

26/11 2017

dev-master

9999999-dev

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

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

by Emerson Carvalho

social media numbers counters

26/11 2017

1.0.0

1.0.0.0

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

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

by Emerson Carvalho

social media numbers counters