Test Ar-PHP Functionality Online

header line!
Test PHP Function










Ar-PHP Manual

static method identify [line 122]

static array identify( string $str)

Identify Arabic text in a given UTF-8 multi language string



Tags:

return:  Offset of the beginning and end of each Arabic segment in sequence in the given UTF-8 multi language string
author:  Khaled Al-Sham'aa <khaled@ar-php.org>
access:  public


Parameters:

string   $str   UTF-8 multi language string

Example
  1.      include('./I18N/Arabic.php');
  2.      $obj new I18N_Arabic('Identifier');
  3.  
  4.      $hStr=$obj->highlightText($str'#80B020');
  5.  
  6.      echo $str '<hr />' $hStr '<hr />';
  7.  
  8.      $taggedText $obj->tagText($str);
  9.  
  10.      foreach($taggedText as $wordTag{
  11.          list($word$tag$wordTag;
  12.  
  13.          if ($tag == 1{
  14.              echo "$word is Noun, ";
  15.          }
  16.  
  17.          if ($tag == 0{
  18.              echo "$word is not Noun, ";
  19.          }
  20.      }
Popular
Recent
Links
Ads!
footer line!

No Software Patents! General Public License

Home | Twitter | Blog | Contact

Copyright © 2006 - 2016 Khaled Al-Sham'aa