PHP code example of benmorel / gsm-charset-converter

1. Go to this page and download the library: Download benmorel/gsm-charset-converter library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

benmorel / gsm-charset-converter example snippets


use BenMorel\GsmCharsetConverter\Converter;

$converter = new Converter();
$utf8 = $converter->convertGsmToUtf8('...');

$gsm = $converter->convertUtf8ToGsm('Helló', false, '?'); // Hell?

$gsm = $converter->convertUtf8ToGsm('Helló', true, '?'); // Hello

$utf8 = $converter->cleanUpUtf8String('Helló', false, '?'); // Hell?
$utf8 = $converter->cleanUpUtf8String('Helló', true, '?'); // Hello

use BenMorel\GsmCharsetConverter\Packer;

$packer = new Packer();
$packed = $packer->pack('ABC'); // the binary string 41E110
$string = $packer->unpack("\x41\xE1\x10"); // ABC