Here i have one array , i want to make first key value default checked using php ,
My array --- print_r($compoItem);
Array
(
[0] => Rice+chapathi
[1] => Chappathi
[2] => Pepsi
[3] => 7up
)
My HTML
<?php
$compoItem = explode(',',$sql2['combo']);
foreach($compoItem as $comValues)
{
?>
<div class="radio">
<ul><input type="radio" name="optradio" checked=""><?php echo $comValues?></ul>
</div>
<?php } ?>
Here last keu value is deafult checked but for me don't want last value i want key value is default checked , how can do this?