RESULT
);
test(radioTableRow('apple', ['yucky','yummy'] ), <<<'RESULT'
apple
RESULT
);
test(radioTableRow('apple', ['yucky'] ), <<<'RESULT'
apple
RESULT
);
test(radioTableRow('apple', [] ), <<<'RESULT'
apple
RESULT
);
test( radioTable( ['apple'], ['yucky','yummy'] ), <<<'RESULT'
yucky
yummy
apple
RESULT
);
test( radioTable( ['apple','banana','cantaloupe'], [] ), <<<'RESULT'
apple
banana
cantaloupe
RESULT
);
test( radioTable( [], [] ), <<<'RESULT'
RESULT
);
// MENTION TYPES AND A SHORT PURPOSE-STATEMENT HERE
//
function radioTable( $rowHeads, $colHeads ) {
$rowsSoFar = radioHeaderRow($colHeads);
for ($rowHeads AS $rowHead) {
$rowsSoFar .= radioTableRow( $rowHead, $colHeads );
}
return $rowsSoFar;
}
//TODO for homework: add a parameter: the radioTable's purpose/name,
// which might get used for
// (a) grouping all its radio-buttons together, for the handler's $_POST
// (b) could also serve as an `id` attribute for the entire table.
// Adjust test cases appropriately, *then* adjust code.