zepi/unicode

Unicode blocks with English and German names, as well as with the regex pattern.

v1.0.0 2022-09-23 18:08 UTC

This package is auto-updated.

Last update: 2024-11-23 22:36:45 UTC


README

A PHP library with all unicode blocks. For every block the library contains the English and the German name as well as the start and end value and the regex pattern to match the block.

composer require zepi/unicode

Usage

To use the library, use the following options:

a) Use the UnicodeIndex

<?php

require_once(__DIR__ . '/vendor/autoload.php');

use zepi\Unicode\UnicodeIndex;

$unicodeIndex = new UnicodeIndex();

// Get all blocks
var_dump($unicodeIndex->getIndex());

// Get a block by key
var_dump($unicodeIndex->getBlockByKey('BasicLatin'));

b) Initialize the block directly

<?php

require_once(__DIR__ . '/vendor/autoload.php');

use zepi\Unicode\Block\BasicLatinBlock;

$basicLatinBlock = new BasicLatinBlock();

var_dump($basicLatinBlock);

License

MIT (see LICENSE)

Copyright

Copyright 2022 Matthias Zobrist