word count example in php

word count example in php

<?php
$message = "this will have some text filtered out";
$result = str_word_count($message);
echo $result;
?>