The str_word_count() function can be used to counts the number of words in a string. Syntax string – Required. Specifies the string…

The str_word_count() function can be used to counts the number of words in a string. Syntax string – Required. Specifies the string…