<?php
$repeat_days = "0,1,2";
$repeat_array = explode(",", $repeat_days);
foreach ($repeat_array as $repeat_array1): ?>
<label class="checkbox-inline">
<input type="checkbox" name="day[]" value="0">SUN
</label>
<label class="checkbox-inline">
<input type="checkbox" name="day[]" value="1">MON
</label>
<label class="checkbox-inline">
<input type="checkbox" name="day[]" value="2">TUE
</label>
<label class="checkbox-inline">
<input type="checkbox" name="day[]" value="3">WED
</label>
<label class="checkbox-inline">
<input type="checkbox" name="day[]" value="4">THU
</label>
<label class="checkbox-inline">
<input type="checkbox" name="day[]" value="5">FRI
</label>
<label class="checkbox-inline">
<input type="checkbox" name="day[]" value="6">SAT
</label>
<?php endforeach; ?>
我需要在php中編輯時自動檢查複選框。在這裏我輸入了一個像0,1,2一樣的靜態值。 0-> SUN,1-> MON,2-> TUE。在這種情況下,如果foreach值等於複選框值,則複選框會自動檢查。我該如何解決這個朋友?複選框在php中編輯時檢查
請指引我
感謝
您的代碼創建21的複選框。他們應該檢查哪些? –