function countWords($str) {
return str_word_count($str);
}
// Example usage:
$string = "The quick brown fox jumps over the lazy dog";
echo "Word count: " . countWords($string);
Subscribe
Login
0 Comments