Building array keys using a span of numbers for like values
I like the idea of putting the discount steps into an array, but stating a discount for every possible quantity seems too much.

$leg_directory_discount = array(
    0 =&gt; 0,
    6   =&gt;  .50,
    11  =&gt;  1,
    21  =&gt;  1.5,
);


This is the discount configuration - can later be stored in a config file or database.

This function gets the discount to be used:

function getDiscount($qty, $leg_directory_discount) {
  $return = 0;
  foreach ($leg_directory_discount as $amount =&gt; $discount) {
    if ($qty &gt;= $amount) {
      $return = $discount;
    }
  }
  return $discount;
}