So I have multidimensional array like this:
$array = ['TITLE' => ['A', 'B1, B2','C']];
If I push it to dropDownList(), I will get html select tag where ‘TITLE’ will be optgroup label, and options of that optgroup will be this:
<option value="0">A</option>
<option value="1">B1, B2</option>
<option value="2">C</option>
I want my options values to contain option labels as values, not 0,1,2… because 0,1,2 is useless to me, I need those values to store them in database.
So I need options to look like this:
<option value="A">A</option>
<option value="B1, B2">B1, B2</option>
<option value="C">C</option>
How can I do this ?