function generate_table($subjects, $completed_subjects) {
$output = '';
foreach ($subjects as $subject => $coefficient) {
$is_completed = in_array($subject, $completed_subjects);
$bg_color = $is_completed ? 'lightgreen' : 'white';
$output .= '
';
return $output;
}
' . $subject . ' | '; $output .= '' . $coefficient . ' | '; $output .= ''; $output .= ''; $output .= ' | '; $output .= '
Comments
Post a Comment