I'm not sure I understand what you're trying to do from your description, but I think you're trying to:
1) Print out checkboxes
2) Pre-check the checkboxes from database data (maybe from the user's previous selections?)
3) Return an array (keyword) when the user submits, which will contain the new selections
If so, I would think the easiest way to do it would be something like this:
/ set up array of checkbox choices /
$type=array( "software", "hardware", "internet" );
/ split db field into array of previous values /
$keyword=explode( " ", $section );
foreach( $type as $key => $value ){
print( "<input type=\"checkbox\" name=\"keyword[$key]\" value=\"$value\"" );
if( in_array( $value, $keyword ) ){
print( " checked" );
}
print( "><br>" );
}
This should print out three checkboxes for "software", "hardware", and "internet", and check
any that were in the database field "$section"
Obviously you would expand the array "$type" to include all your checkbox choices.
/Zureash