Text_LanguageDetect
[ class tree: Text_LanguageDetect ] [ index: Text_LanguageDetect ] [ all elements ]

Source for file iso.php

Documentation is available at 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. $l = new Text_LanguageDetect();
  9.  
  10.  
  11. //will output the ISO 639-1 two-letter language code
  12. // "de"
  13. $l->setNameMode(2);
  14. echo $l->detectSimple('Das ist ein kleiner Text'"\n";
  15.  
  16. //will output the ISO 639-2 three-letter language code
  17. // "deu"
  18. $l->setNameMode(3);
  19. echo $l->detectSimple('Das ist ein kleiner Text'"\n";
  20.  
  21. ?>

Documentation generated on Mon, 11 Mar 2019 15:47:09 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.