Another approach would be:
$priceList = array(1 => '39', '36', '36', '34', '34', '32', '32', '32', '32', '32', '29', '29', '29', '29', '29', '29', '29', '29', '29', '29', '27');
if ($quantity >= 21) {
$unitPrice = $priceList[21];
} else {
$unitPrice = $priceList[$quantity];
}
Almost as bad for maintainability, but less coding to do...