public static function extractKanji($str, $length = 0)
{
// No length given, extract kanji substrings as it is.
if (!$length) {
return preg_split(self::PREG_PATTERN_NOT_KANJI, $str, 0, PREG_SPLIT_NO_EMPTY);
}
// Otherwise...
// remove any non kanji characters and split the remaining string as per
// the given length
$str = preg_replace(self::PREG_PATTERN_NOT_KANJI, "", $str);
return self::split($str, $length);
}