<?php $str = "fjsdklhfansioehfacsopfmiamsopeiamsohqxsf.ansf.as,mnf,.asnfas.d,rtas."; function numara_vocale($s){ $vocale = array('A'=>0,'E'=>0,'I'=>0,'O'=>0,'U'=>0); foreach(count_chars($s) as $k => $v){ $upchr = strtoupper(chr($k)); if (array_key_exists($upchr,$vocale)){ $vocale[$upchr] += $v; } } return $vocale; } print_r(numara_vocale($str)); ?>