2017 © Pedro PelĂĄez
 

library sms-counter-php

SMS Counter PHP Class Library which detects encoding of an SMS message text, counts the characters as per the encoding and gives page limit information.

image

instasent/sms-counter-php

SMS Counter PHP Class Library which detects encoding of an SMS message text, counts the characters as per the encoding and gives page limit information.

  • Thursday, May 11, 2017
  • by markitosgv
  • Repository
  • 2 Watchers
  • 13 Stars
  • 13,205 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 6 Forks
  • 1 Open issues
  • 9 Versions
  • 16 % Grown

The README.md

Instasent - SMS Counter for PHP

Character counter for SMS Messages, (*1)

Build Status SensioLabsInsight, (*2)

Usage

use Instasent\SMSCounter\SMSCounter;

$smsCounter = new SMSCounter();
$smsCounter->count('some-string-to-be-counted');
$smsCounter->countWithShiftTables('some-string-to-be-counted');

which returns, (*3)

stdClass Object
(
[encoding]    => GSM_7BIT
[length]      => 25
[per_message] => 160
[remaining]   => 135
[messages]    => 1
)
UTF16 notice

When using unicode chars over U+10000 (mainly emoticons 😎) on messages larger than 70 chars the remaining value will actually be the remaining chars in last message part only, this is due to how those chars are encoded using two 16bit chars and max part length being an odd number (67), (*4)

Sanitization

You can sanitize your text to be a valid strict GSM 03.38 charset, (*5)

use Instasent\SMSCounter\SMSCounter;

$smsCounter = new SMSCounter();
$smsCounter->sanitizeToGSM('dadĂĄĂł'); //return dadao

National Language Shift Tables

Starting release 8 of GSM 03.38 some additional charsets are allowed. This is the list of such National Language Shift Tables currently supported, (*6)

Installation

sms-counter-php is available via composer on packagist., (*7)

{
    "require": {
       "instasent/sms-counter-php": "^0.4"
    }
}

License

SMS Counter (PHP) is released under the MIT License, (*8)

Mentions

The Versions

11/05 2017

dev-master

9999999-dev http://github.com/instasent/sms-counter-php

SMS Counter PHP Class Library which detects encoding of an SMS message text, counts the characters as per the encoding and gives page limit information.

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

The Development Requires

sms counter gsm mobile unicode

11/05 2017

v0.4.1

0.4.1.0 http://github.com/instasent/sms-counter-php

SMS Counter PHP Class Library which detects encoding of an SMS message text, counts the characters as per the encoding and gives page limit information.

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

The Development Requires

sms counter gsm mobile unicode

21/03 2017

v0.4.0

0.4.0.0 http://github.com/instasent/sms-counter-php

SMS Counter PHP Class Library which detects encoding of an SMS message text, counts the characters as per the encoding and gives page limit information.

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

The Development Requires

sms counter gsm mobile unicode

07/10 2016

v0.2.3

0.2.3.0 http://github.com/instasent/sms-counter-php

SMS Counter PHP Class Library which detects encoding of an SMS message text, counts the characters as per the encoding and gives page limit information.

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

sms counter gsm mobile unicode

07/10 2016

v0.3.0

0.3.0.0 http://github.com/instasent/sms-counter-php

SMS Counter PHP Class Library which detects encoding of an SMS message text, counts the characters as per the encoding and gives page limit information.

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

sms counter gsm mobile unicode

07/10 2016

v0.2.2

0.2.2.0 http://github.com/instasent/sms-counter-php

SMS Counter PHP Class Library which detects encoding of an SMS message text, counts the characters as per the encoding and gives page limit information.

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

sms counter gsm mobile unicode

22/12 2015

v0.2.1

0.2.1.0 http://github.com/wobblecode/sms-counter-php

SMS Counter PHP Class Library which detects encoding of an SMS message text, counts the characters as per the encoding and gives page limit information.

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

sms counter gsm mobile unicode

18/07 2015

v0.2.0

0.2.0.0 http://github.com/wobblecode/sms-counter-php

SMS Counter PHP Class Library which detects encoding of an SMS message text, counts the characters as per the encoding and gives page limit information.

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

sms counter gsm mobile unicode

18/07 2015

v0.1.0

0.1.0.0 http://github.com/wobblecode/sms-counter-php

SMS Counter PHP Class Library which detects encoding of an SMS message text, counts the characters as per the encoding and gives page limit information.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

sms counter gsm mobile unicode