I am trying to execute foreach loop but it doesn't show any value on HTML form. Here is code.
function displayOptions($options){
foreach($options as $option){
    printf("<option value='%s'>%s</option>",strtolower($option),ucwords($option));
}}
Here is a array..
$fruits=["mango","apple","orange","banana","coconut"];
Here is an HTML Code.
<select name="fruits" id="fruits">
   <option value="" disabled selected>Select Some Fruits</option>
     <?php displayOptions($fruits);?>
</select>
Can you help me?
 
    