File: README.md

Recommend this page to a friend!
  Classes of Peter Kahl  >  Character Set From String  >  README.md  >  Download  
File: README.md
Role: Documentation
Content type: text/markdown
Description: Documentation
Class: Character Set From String
Identify predominant character set in a string
Author: By
Last change: Update README.md
Date: 6 months ago
Size: 1,897 bytes
 

Contents

Class file image Download

Charset From String

Identifies predominant script (charset, language) in a string. This library is capable of identifying:

<pre> Arabic Armenian Bengali Burmese CJK Cyrillic Devanagari Georgian Greek Gujarati Hebrew Japanese Khmer Korean Lao Latin Malayalam Sinhala Tamil Thai Tibetan </pre>

Usage

use peterkahl\CharsetFromString\CharsetFromString;

echo CharsetFromString::getCharset('????? ????? ?? ???????'); # ARABIC

echo CharsetFromString::getCharset('????? ????? ?? ????-??'); # HEBREW

echo CharsetFromString::getCharset('??? ?????? ?????? ??????, ??? ??? ?? ?????.'); # CYRILLIC

echo CharsetFromString::getCharset('The true hero is he who conquers his own anger and hatred.'); # LATIN

echo CharsetFromString::getCharset('??? ??? ?? ??? ??? ???? ??.'); # KOREAN

echo CharsetFromString::getCharset('??????????????'); # JAPANESE

echo CharsetFromString::getCharset('????????????'); # CJK

echo CharsetFromString::getCharset('??????????????? ??????????????'); # THAI

echo CharsetFromString::getCharset('????????????????????????????????????? ????'); # LAO

echo CharsetFromString::getCharset('?????????????????????????????????????????????'); # KHMER

echo CharsetFromString::getCharset('???????????????????????????????'); # TIBETAN

echo CharsetFromString::getCharset('? ????? ???????? ??? ???????? ?????? ????, ???? ???????? ???? ??? ??????.'); # GREEK

For more information send a message to info at phpclasses dot org.