echo '<input type="checkbox" name="check_list[]" value="OMG" checked>';
this way will display a normal checkbox with checked. My question is that is it possible to put a if else inside the checkbox?
For example,
echo '<input type="checkbox" name="check_list[]" value="OMG" "if(2>1){ echo "checked";};" >';
The reason i want to do this is because I have a array with 6 data, if certain condition meet, the checkbox will be checked. If the echo method i mentioned above is invalid, so what's the correct way of doing that?
$zzz[1]="western food";
$zzz[2]="chinese food";
$zzz[3]="mix food";
$zzz[4]="japanese food";
$zzz[5]="korean food";
$zzz[6]="italian food";