Unicode Ranges

Build Status Documentation Status License: GPL v3 Unicode Character Ranges

Unicode character ranges (or blocks) in a friendly object-oriented way for multiple purposes. See Unicode ranges.

Install

Via composer:

$ composer require programarivm/unicode-ranges

Example

Here is an example showing how to use AlchemicalSymbols.

use UnicodeRanges\Range\AlchemicalSymbols;

$alchemicalSymbols = new AlchemicalSymbols;

echo "Name: {$alchemicalSymbols->name()}".PHP_EOL;
echo "Total: {$alchemicalSymbols->count()}".PHP_EOL;
echo "Range: {$alchemicalSymbols->range()[0]}-{$alchemicalSymbols->range()[1]}".PHP_EOL;
echo 'Characters: '.PHP_EOL;
print_r($alchemicalSymbols->chars());

Output:

Name: Alchemical Symbols
Total: 128
Range: 1F700-1F77F
Characters:
Array
(
    [0] => 🜀
    [1] => 🜁
    [2] => 🜂
    [3] => 🜃
    [4] => 🜄
    [5] => 🜅
    [6] => 🜆
    [7] => 🜇
    ...

name()

Gets the name of the Unicode range.

$name = $alchemicalSymbols->name();

count()

Counts the number of characters in a range.

$count = $alchemicalSymbols->count();

range()

Returns the Unicode range in hexadecimal format.

$range = $alchemicalSymbols->range();

chars()

Returns an array containing the chars of that range.

$chars = $alchemicalSymbols->chars();

See more examples.

Documentation

For further information please read the Documentation.

License

The GNU General Public License.

Contributions

Would you help make this library better? Contributions are welcome.

  • Feel free to send a pull request
  • Drop an email at info@programarivm.com with the subject "Unicode Ranges"
  • Leave me a comment on Twitter
  • Say hello on Google+

Many thanks.