Comparing arrays in Yii
$settings = CHtml::listData(GeneralSettings::model()->findAll("`group` = 'email'"), "setting", "value");
$collectLogData = array(
"emailServer" => $post["emailServer"],
"emailPort" => $post["emailPort"],
"emailUsername" => $post["emailUsername"],
"emailPassword" => $post["emailPassword"],
"emailEncryption" => $post["encryption"],
"emailAuth" => $post["emailAuthentication"],
);
// Compare posted data array with currently saved settings array, and remove key if no difference
$compareData = array_diff($collectLogData, $settings);
$logData = $compareData;
$logList = '<br><br><ul class="list">';
foreach ($logData as $key=>$value) {
$logList .= '<li>' . $key . ': ' . $value . '</li>';
}
$logList .= '</ul>';