Antal ord i en sträng med PHP <?php $str = "How many words do I have?"; echo str_word_count($str); //Outputs 6 ?>