Total numbers of Vowels - PHP Online

Form of PHP Sandbox

Enter Your PHP code here for testing/debugging in the Online PHP Sandbox. As in the usual PHP files, you can also add HTML, but do not forget to add the tag <?php in the places where the PHP script should be executed.



Your result can be seen below.

Result of php executing





Full code of Total numbers of Vowels.php

  1. <?php
  2. $str="This is a morning of October thirty";
  3. $string=strtolower($str);
  4. $vowel=array('a','e','i','o','u');
  5. $len=strlen($string);
  6. $num=0;
  7. for($i=0;$i<$len;$i++)
  8. {
  9.     if(in_array($string[$i],$vowel))
  10.     {
  11.         $num++;
  12.     }
  13. }
  14. echo" ".$num;
  15. ?>
File Description
  • Total numbers of Vowels
  • PHP Code
  • 13 Jan-2021
  • 249 Bytes
You can Share it: