$val) { if (empty($val)) { unset($list[$key]); } else { $list[$key] .= ';'; } } return array_values($list); } }