function combine_and_format_values() {
// Add the default values
$default_values = array('אח.ות', 'דוד.ה', 'סבא. סבתא');
// Get the dynamic value from the form field
$dynamic_value = FrmProEntriesController::get_field_value_shortcode(array('field_id' => 1942, 'user_id' => 'current'));
// Split the dynamic value into an array
$dynamic_values_array = explode(',', $dynamic_value);
// Combine the default and dynamic values
$combined_values = array_merge($default_values, $dynamic_values_array);
// Number of Columns to generate
$cols = 3;
// Format the values into an HTML unordered list
$html_output = '<table>';
$html_output .= '<tr>';
$i = 1;
foreach ($combined_values as $value) {
$html_output .= '<td>• ' . $value . '</td>';
if ($i % $cols === 0) {
$html_output .= '</tr>';
if ($i !== count($combined_values)) {
$html_output .= '<tr>';
}
} else if ($i === count($combined_values)) {
do {
$html_output .= '<td></td>';
$i++;
} while ($i % $cols !== 0);
$html_output .= '</tr>';
}
$i++;
}
$html_output .= '</table>';