Heim  >  Artikel  >  Backend-Entwicklung  >  php使用数组填充下拉列表框的方法_PHP教程

php使用数组填充下拉列表框的方法_PHP教程

WBOY
WBOYOriginal
2016-07-13 09:58:351010Durchsuche

php使用数组填充下拉列表框的方法

 本文实例讲述了php使用数组填充下拉列表框的方法。分享给大家供大家参考。具体实现方法如下:

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

$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></script>

function onCambioDeOpcion(combobox) {

alert("Seleccionaste: " + combobox[combobox.selectedIndex].text +

" \nSu valor es: " + combobox.value);

}

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/977161.htmlTechArticlephp使用数组填充下拉列表框的方法 本文实例讲述了php使用数组填充下拉列表框的方法。分享给大家供大家参考。具体实现方法如下: 1 2...
Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn