Download the PHP package poletaew/sms-segment-calculator without Composer
On this page you can find all versions of the php package poletaew/sms-segment-calculator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download poletaew/sms-segment-calculator
More information about poletaew/sms-segment-calculator
Files in poletaew/sms-segment-calculator
Package sms-segment-calculator
Short Description PHP-based tool to calculate and display SMS segmentation data for a given message body
License MIT
Informations about the package sms-segment-calculator
SMS Segment Calculator
A PHP library that enables you to calculate the message segments used for sending a message on the GSM network. A port of Twillio's Segment Calculator.
Usage
Installation
Sample usage
Documentation
SegmentedMessage
class
This is the main class exposed by the package
__construct($message, $encoding, $smartEncoding)
Arguments:
$message
: Body of the SMS$encoding
: Optional: encoding. It can beSmsEncoding
enum value orauto
. Default value:auto
$smartEncoding
: Optional: if smart encoding enabled. Default value:false
getRealEncodingName()
Returns the name of the calculated encoding for the message: GSM-7
or UCS-2
getTotalSize()
Total size of the message in bits (including User Data Header if present)
getMessageSize()
Total size of the message in bits (excluding User Data Header if present)
getSegmentsCount()
Number of segment(s)
getNonGsmCharacters()
Return an array with the non GSM-7 characters in the body. It can be used to replace character and reduce the number of segments
getNumberOfUnicodeScalars()
Number of Unicode scalars
getNumberOfCharacters()
Number of characters
Contributing
This code is open source and welcomes contributions.
The source code for the library is all contained in the src
folder.
Before submitting a PR run Unit test in the directory test/Unit
and make sure all tests pass.
License
Disclaimer
No warranty expressed or implied. Software is as is.
All versions of sms-segment-calculator with dependencies
ext-mbstring Version *
ext-intl Version *