countKanji() public static méthode

Count number of kanji within the specified string.
public static countKanji ( string $str, boolean $extended = false ) : integer
$str string The input string.
$extended boolean Determines whether to use the extended kanji set
Résultat integer Returns the number of kanji.
Exemple #1
0
 public function testCountKanjiExtended()
 {
     $result = Analyzer::countKanji('三ヶ日', TRUE);
     $this->assertEquals(3, $result);
 }
Exemple #2
0
 public function testCountKanjiWhenNoKanji()
 {
     $result = Analyzer::countKanji($this->hiraganaCharacters);
     $this->assertEquals($result, 0);
 }