<?php
function countVowels($str) {
$vowels = ['a', 'e', 'i', 'o', 'u'];
$str = strtolower($str);
return count(array_intersect(str_split($str), $vowels));
}
// Example usage:
$count = countVowels('Hello, World!');
echo "Number of vowels: $count";
?>