Skip to content
Advertisement

Populate option tags using three values from each row of a multidimensional array

I want to populate option tags from my array:

JavaScript

I tried with:

JavaScript

But I get a blank page as result.

I expect:

JavaScript

Advertisement

Answer

You could use array_map to transform the input array into the html code for a <option> then implode all, using only one statement:

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement