3v4l.org

run code in 300+ PHP versions simultaneously
<?php function get_position($string) { $vowels = array("a,e,i,o,u"); $first_letter = strtolower(substr($string,0,1)); echo $first_letter."<br>"; print_r($vowels); $new_string = ""; if( in_array($first_letter,$vowels) ) { $new_string = "an <strong>".ucfirst($string)."</strong>"; } else { $new_string = "a <strong>".ucfirst($string)."</strong>"; } return $string; } $output = get_position("Advertising"); echo $output;

preferences:
38.62 ms | 402 KiB | 5 Q