A.C.Manikandan A.C.Manikandan - 7 months ago 14
SQL Question

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

I have the following values

add,view,edit,delete


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

Answer

Use explode() function.

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