Programming Code Center(PCC)
[PHP]

(PCC)::[How-to-Count-the-number-of-words-in-a-string-using-str_word_count()-function-in-php]::[php]

File Name : index.php

<!DOCTYPE html>
<html>
<body>

<?php
echo str_word_count("Hello world!");
?> 
 
</body>
</html>

Output :