A.C.Manikandan A.C.Manikandan - 1 year ago 54
SQL Question

how to add the check box for each values after the comma in php?

I have the following values


How to add the checkbox for each value after the comma.please help me

Answer Source

Use explode() function.

$val = "add,view,edit,delete";
$valArr = explode(",", $val);
foreach($valArr as $name)
    echo "<input type='checkbox' name='type[]' value='".$name."'>".$name." ";