craigbabe Posted April 16, 2006 Share Posted April 16, 2006 All I can find is how many characters there is but I want words. Do you know how i can do this?Happy Easter btw Quote Link to comment https://forums.phpfreaks.com/topic/7524-counting-the-amount-of-words-in-a-string/ Share on other sites More sharing options...
toplay Posted April 16, 2006 Share Posted April 16, 2006 PHP 4.3.0+ example:[code]$msg = "Hello world!";echo str_word_count($msg); // displays 2[/code][a href=\"http://us2.php.net/manual/en/function.str-word-count.php\" target=\"_blank\"]http://us2.php.net/manual/en/function.str-word-count.php[/a] Quote Link to comment https://forums.phpfreaks.com/topic/7524-counting-the-amount-of-words-in-a-string/#findComment-27403 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.