foreach($cek['ozellik_ozellik'] as $row){
$check = false;
foreach($ilan['ilan_ozellik'] as $key => $value){
$key = str_replace("_"," ",$key);
if($key == $row){
$check = true;
}
}?>
<label class="custom-switch mt-5 mb-3">
<input type="checkbox" name="<?php echo $row; ?>" class="custom-switch-input" <?php if($check) echo "checked"; ?>>
<span class="custom-switch-indicator"></span>
<span class="custom-switch-description"><?php echo $row; ?></span>
</label>
<?php }
hocam sizden Allah razı olsun çok sağolun bu kod işe yaradı.