Determine Language Script of Strings
Detect if a string contains different language scripts with a simple API., (*1)
, (*2)
Installation
You just require using composer and you're good to go!, (*3)
composer require lasserafn/php-string-script-language
Usage
As with installation, usage is quite simple:, (*4)
use LasseRafn\StringScript;
StringScript::isThai('Hello world.'); // false
StringScript::isChinese('你好世界。'); // true
All methods return a boolean value., (*5)
Supported scripts
- Common
- Arabic
- Armenian
- Bengali
- Bopomofo
- Braille
- Buhid
- Canadian Aboriginal
- Cherokee
- Cyrillic
- Devanagari
- Ethiopic
- Georgian
- Greek
- Gujarati
- Gurmukhi
- Han
- Hangul
- Hanunoo
- Hebrew
- Hiragana
- Inherited
- Kannada
- Katakana
- Khmer
- Lao
- Latin
- Limbu
- Malayalam
- Mongolian
- Myanmar
- Ogham
- Oriya
- Runic
- Sinhala
- Syriac
- Tagalog
- Tagbanwa
- TaiLe
- Tamil
- Telugu
- Thaana
- Thai
- Tibetan
- Yi
- Chinese (Helper for Han)
- Japanese (Helper for Hiragana or Katakana)
All methods
StringScript::isCommon($string);
StringScript::isArabic($string);
StringScript::isArmenian($string);
StringScript::isBengali($string);
StringScript::isBopomofo($string);
StringScript::isBraille($string);
StringScript::isBuhid($string);
StringScript::isCanadian_Aboriginal($string);
StringScript::isCherokee($string);
StringScript::isCyrillic($string);
StringScript::isDevanagari($string);
StringScript::isEthiopic($string);
StringScript::isGeorgian($string);
StringScript::isGreek($string);
StringScript::isGujarati($string);
StringScript::isGurmukhi($string);
StringScript::isHan($string);
StringScript::isHangul($string);
StringScript::isHanunoo($string);
StringScript::isHebrew($string);
StringScript::isHiragana($string);
StringScript::isInherited($string);
StringScript::isKannada($string);
StringScript::isKatakana($string);
StringScript::isKhmer($string);
StringScript::isLao($string);
StringScript::isLatin($string);
StringScript::isLimbu($string);
StringScript::isMalayalam($string);
StringScript::isMongolian($string);
StringScript::isMyanmar($string);
StringScript::isOgham($string);
StringScript::isOriya($string);
StringScript::isRunic($string);
StringScript::isSinhala($string);
StringScript::isSyriac($string);
StringScript::isTagalog($string);
StringScript::isTagbanwa($string);
StringScript::isTaiLe($string);
StringScript::isTamil($string);
StringScript::isTelugu($string);
StringScript::isThaana($string);
StringScript::isThai($string);
StringScript::isTibetan($string);
StringScript::isYi($string);
StringScript::isChinese($string);
StringScript::isJapanese($string);
Requirements