This article describes how to use php to fill the drop-down list box with arrays. it involves php array operations and has some reference value, for more information about how to fill the drop-down list box with arrays in php, see the following example. Share it with you for your reference. The specific implementation method is as follows:
<? Php $ data = array (object) array ("titulo" => "Ford", "valor" => "opcion1"), (object) array ("titulo" => "Peugeot", "valor" => "opcion2"), (object) array ("titulo" => "Chevrolet ", "valor" => "opcion3"), (object) array ("titulo" => "Volskwagen", "valor" => "opcion4"),);?>
Script function onCambioDeOpcion (combobox) {alert ("Seleccionaste:" + combobox [combobox. selectedIndex]. text + "\ nSu valor es:" + combobox. value);} script
Seleccione fabricante<? Phpfor ($ I = 0; $ I<? Php echo $ data [$ I]-> titulo?><? Php }?>
I hope this article will help you with php programming.