I want to count the number of words in a string. But it should be accurate even if it contains (,;':"/) or any other symbol.
Use str_word_count(); Example: $count = str_word_count($string); http://php.net/manual/en/function.str-word-count.php