承接 voodoosms/sms-encoding 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

voodoosms/sms-encoding

最新稳定版本:v2.0.2

Composer 安装命令:

composer require voodoosms/sms-encoding

包简介

SMS encoding library

README 文档

README

Get the length, number of characters, number of segments and encoding of an SMS.

Installation

composer require voodoosms/sms-encoding

Usage

Message

Available methods:

$message = new Message(string $payload)

$message->is7Bit();
$message->isGsm7(); // alias of is7Bit()

$message->is8Bit();
$message->isUcs2(); // alias of is8Bit()
$message->isUnicode(); // alias of is8Bit()

$message->getLength();
$message->getNumberOfSegments();
$message->getNumberOfCharacters();

Gsm7Message

Available methods:

$message = new Gsm7Message(string $payload)

$message->getLength();
$message->getNumberOfSegments();
$message->getNumberOfCharacters();

UnicodeMessage

Available methods:

$message = new UnicodeMessage(string $payload)

$message->getLength();
$message->getNumberOfSegments();
$message->getNumberOfCharacters();

Gsm7Characters

Available methods:

Gsm7Characters::isValidCharacter(string $character, bool $hexadecimal = false);
Gsm7Characters::getCharacterWeighting(string $character, bool $hexadecimal = false);
Gsm7Characters::$hexadecimal; // An array keyed by the hex-encoded version, with the value being the characters weighting
Gsm7Characters::$plaintext; // An array keyed by the plaintext version, with the value being the hex-encoded version
$testValid = 'T';
$testValidHex = '54';
$testInvalid = '🚀';
$testInvalidHex = 'f09f9a80';

Gsm7Characters::isValidCharacter($testValid); // true
Gsm7Characters::isValidCharacter($testValidHex, true); // true
Gsm7Characters::isValidCharacter($testInvalidHex); // false
Gsm7Characters::isValidCharacter($testInvalidHex, true); // false

Gsm7Characters::getCharacterWeighting($testValid); // 1
Gsm7Characters::getCharacterWeighting($testValidHex, true); // 1
Gsm7Characters::getCharacterWeighting($testInvalidHex); // Throws InvalidGsm7CharacterException
Gsm7Characters::getCharacterWeighting($testInvalidHex, true); // Throws InvalidGsm7CharacterException

You likely will never need to use Gsm7Message or UnicodeMessage as the Message class is just a proxy for these two classes.

统计信息

  • 总下载量: 1.85k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-07-28

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固