3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string='maría'; $vocales = preg_match_all('/[aeiouáéíó]/i',$string, $matchesV); echo "<br>vocales = $vocales"; if ((in_array('á',$matchesV))||(in_array('é',$matchesV)) || (in_array('í',$matchesV)) || (in_array('ó',$matchesV))){ $v = $vocales - 1; echo "<br>v $v"; echo '<br>1'; }

preferences:
32.64 ms | 402 KiB | 5 Q