如何用php控制 select 中的选定值?
比如我有个select的表单
<br /><select name="select_1"><br /><option value=""></option><br /><option value="value_1">option_1</option><br /><option value="value_2">option_2</option><br />.....<br /><option value="value_n">option_n</option><br /></select></td><br />
最后的n也许会很大,我的设计是用户表单提交后,存入mysql,然后用户可以再编辑,那么在编辑页面,这个单选表单必须显示为mysql中的值为选中状态。我已经把mysql中的值读出来了是 $value_select_1,那怎么用php控制这个select_1表单将value为$value_select_1的值选中呢?
刚学php不久,希望不吝赐教。
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn