1 回答
TA贡献1871条经验 获得超8个赞
你的代码有点乱,顺便说一下,希望我能帮到你:
$checklistIni = 'a:16:{i:0;s:3:"nao";i:1;s:3:"ava";i:2;s:3:"tem";i:3;s:3:"tem";i:4;s:3:"tem";i:5;s:3:"tem";i:6;s:3:"tem";i:7;s:3:"tem";i:8;s:3:"tem";i:9;s:3:"tem";i:10;s:3:"tem";i:11;s:3:"tem";i:12;s:3:"tem";i:13;s:3:"tem";i:14;s:3:"tem";i:15;s:3:"tem";}';
$checkIni = unserialize($checklistIni);
$rsChecklist = array(
array(
'nome' => 'A',
)
);
foreach ($rsChecklist as $k => $checklist) {
foreach ($checkIni as $key => $val) {
?>
<table>
<tr>
<td class="texto-branco">
<?php echo $checklist['nome'] ?>
</td>
<td><label><input value="tem" name="checklistFim<?php echo $key ?>" class="checklistFim"
type="radio" <?php if ($val == "tem") {
echo "checked='checked' ";
}; ?> /><span></span></label></td>
<td><label><input value="nao" name="checklistFim<?php echo $key ?>" class="checklistFim"
type="radio" <?php if ($val == "nao") {
echo "checked='checked' ";
}; ?> /><span></span></label></td>
<td><label><input value="ava" name="checklistFim<?php echo $key ?>" class="checklistFim"
type="radio" <?php if ($val == "ava") {
echo "checked='checked' ";
}; ?> /><span></span></label></td>
</tr>
</table>
<?php
}
}
本质上,您必须更改这些行<input value="tem" name="checklistFim<?php echo $checklist['ID_Checklist'] ?>" class="checklistFim" type="radio" <?php if($checkIni[$key] == "tem"){echo "checked ";}; ?> /> 。name车道中三个无线电中的每一个的属性必须相同,并且与其他车道不同。
- 1 回答
- 0 关注
- 155 浏览
添加回答
举报