<?php

function dynAuswahl (string $id, string $name, array $options, bool $multiple) {

if ($multiple == 1) {
    
    $multiple ="multiple";
}

switch($id){

        case "dynamisch1":
            echo"<select id='$id' name='$name' $multiple><br>";
            foreach($options as $wert){
            echo "\n\t\t\t\t\t<option value='$wert'>$wert</option><br>";
            }
            echo "\n\t\t\t\t</select>";
            break;

        case "dynamisch2":
            echo"<select id='$id' name='$name' $multiple><br>";
            foreach($options as $wert){
            echo "\n\t\t\t\t\t<option value='$wert'>$wert</option><br>";
            }
            echo "\n\t\t\t\t</select>";
            break;

    }

}
?>