str_word_count

Supported Versions: PHP 4 >= 4.3.0, PHP 5, PHP 7, PHP 8
Return information about words used in a string
str_word_count(string $stringint $format 0, ?string $characters null): array|int
    public static function wordCount($string$characters null)

    {

        return 
str_word_count($string0$characters);

    }
    public function wordCount()

    {

        return 
str_word_count($this->value);

    }