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. $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. ?>

Documentation generated on Mon, 11 Mar 2019 14:34:13 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.