【发布时间】:2013-11-01 22:50:30
【问题描述】:
我想在一个 php 变量的 HTML 下拉菜单中设置 。我给你我的代码,这样你就可以看到我想要做什么:
<?php
$html_table = '
<table border="0" cellspacing="0" cellpadding="0"><tr>';
while($arr = pg_fetch_array($result1))
{
$html_table .= "<tr><td> $arr[0] </td></tr>";
}
$html_table .='</tr>';
?>
<p>
<select name="db" size="1">
<option> $html_table </option> #### <- that is my question, how to get that working
</select>
</p>
我希望你明白我想要做什么。如果您知道更好的方法,请告诉我。 干杯
【问题讨论】:
-
您不能在
<option>中放置表格。只需放入一系列<option>元素,每个元素都有一个数组元素。