我有一个带有 PHP 下拉字段的表单,其中包含以下数组:
$field["options"] = array(
array("value" => "Chişinău", "text" => "Chişinău", "depth" => 0),
array("value" => "Bălţi", "text" => "Bălţi", "depth" => 0),
array("value" => "Comrat", "text" => "Comrat", "depth" => 0),
...
array("value" => "Ungheni", "text" => "Ungheni", "depth" => 0)
);
如何将<option selected disabled>Choose one</option>
添加为第一个选项?
最佳答案
$field["options"] = array(
array("value" => " ", "text" => "Choose one", "depth" => 0, "selected" => "selected", "disabled" => "disabled"),
//...rest other option code
);
关于php - 添加选项在 PHP 中被禁用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42739380/