by counting the elements in the array....
Code:
$x=array('a','b','c');
for($i=0;$i<count($x);$i++) {
echo "<input type='checkbox' id='chk[$i]' onclick=\"list_array($x[$i]\" />$x[$i]<br>";
}
Comment