I have select box with multiple select. I have an array with value. I want to set selected values of select field based on array.
I have an array
values=array("a","b","c","d","e");
And select field
<select name="check[]" id="check" multiple>
<option value="">--- Select Document Type ----</option>
<option value="a">a</option>
<option value="b">b</option>
<option value="c">c</option>
<option value="d">d</option>
<option value="e">e</option>
<option value="f">f</option>
<option value="g">g</option>
<option value="h">h</option>
</select>
I want options selected as per array.