English

Write Programs for the following. Write a PHP code to count no. of words in the given string.

Advertisements

Question

Write Programs for the following.

Write a PHP code to count no. of words in the given string.

Answer in Brief
Advertisements

Solution

Coding:

<?php
$a="Hypertext Preprocessor";
echo "<br><br> String is ".$a;
echo" <br><br> Words in String is ".str_word_count($a);
?>
shaalaa.com
PHP String Functions
  Is there an error in this question or solution?
Chapter 5: Server-Side Scripting (PHP) - Exercises [Page 78]
Advertisements
Share
Notifications



      Forgot password?
Use app×