php - 我如何使用“选定”属性
问题描述
解决方案
一个简单的例子就是这种情况:
<?php
$a = 1;
?>
<select>
<option value='so and so' <?= ($a === 1) ? 'selected' : ''; ?>>
</select>
推荐阅读
- xamarin.forms - 如何使用 xamarin.forms 在 android 中删除 datepicker 的底线
- postgresql - Postgres:优化一个巨大的 GROUP BY
- swift - swift如何动态更改自定义mkannotationview
- docker - 来自 gitlab-ci docker 的 SSH 在“SSH2_MSG_KEX_ECDH_REPLY”上失败
- loops - 包含多个 if 语句的单个循环或多个内部带有循环的 if 语句?
- sql - sqlite如何用前一个值替换null
- shell - RHEL RPM 规范安装后 %post 未获取 shell 脚本
- java - 用于接受 Multipart 文件的 DELETE 方法的 Mockmvc
- jenkins - Jenkins 在 Jenkinsfile 中使用导入
- bash - 如何在环境变量中捕获 bash 命令组(大括号)的输出