Hope following code would help you with PHP that will be populated data from Server / DB as will as Jquery which will handle any client / user interaction
Disabling with PHP
<?php
$selected_fruit = 'red//pinklady'; // this is got from DB
$selected_group = explode('//', $selected_fruit);
$checkbox_options = '';
// following variable $array_of_checkbox_option as you say should be from DB
$array_of_checkbox_option = array(
array('val'=>'red//fuji', 'display_text'=>'Fuji'),
array('val'=>'red//pinklady', 'display_text'=>'Pink Lady'),
array('val'=>'red//reddelicious', 'display_text'=>'Red Delicious'),
array('val'=>'green//grannysmith', 'display_text'=>'Granny Smith'),
array('val'=>'green//goldendelicious', 'display_text'=>'Golden Delicious')
);
foreach($array_of_checkbox_option as $value){
$group_name = explode('//', $value['val']);
$checkbox_options .= '<input type="checkbox" name="pref[]" value="';
$checkbox_options .= $value['val'].'"';
$checkbox_options .= ($selected_fruit == $value['val']) ? ' checked ' : '';
$checkbox_options .= ($group_name[0] == $selected_group[0]) ? ' disabled ' : '';
$checkbox_options .= '/>'.$value['display_text'].'<br>';
}
echo $checkbox_options;
?>
Disabling with Javascript
<script>
$(document).ready(function() {
$( "input[name^='pref']" ).on('click', function(){
if($(this).is(':checked')){
var group_name = $(this).val().split('//');
var sel_group = group_name[0];
$( "input[name^='pref']" ).each(function(){
var elm_name = $(this).val().split('//');
if(sel_group == elm_name[0]){
$(this).prop('disabled', true);
}
});
}
});
});
</script>