]> git.mxchange.org Git - friendica.git/blob - library/langdet/docs/iso.php
Merge branch 'vagrant2' of https://github.com/silke/friendica into develop
[friendica.git] / library / langdet / docs / iso.php
1 <?php
2 /**
3  * Demonstrates how to use ISO language codes.
4  *
5  * The "name mode" changes the way languages are accepted and returned.
6  */ 
7 require_once 'Text/LanguageDetect.php';
8 $ld = new Text_LanguageDetect();
9
10 //will output the ISO 639-1 two-letter language code
11 // "de"
12 $ld->setNameMode(2);
13 echo $ld->detectSimple('Das ist ein kleiner Text') . "\n";
14
15 //will output the ISO 639-2 three-letter language code
16 // "deu"
17 $ld->setNameMode(3);
18 echo $ld->detectSimple('Das ist ein kleiner Text') . "\n";
19 ?>