Building array keys using a span of numbers for like values I am calculating discounts based on a quantity after 6. 

Is there a cleaner way to do this:

$leg_directory_discount = array(
    6   =&gt;  .50,
    7   =&gt;  .50,
    8   =&gt;  .50,
    9   =&gt;  .50,
    10  =&gt;  .50,
    11  =&gt;  1,
    12  =&gt;  1,
    13  =&gt;  1,
    14  =&gt;  1,
    15  =&gt;  1,
    16  =&gt;  1,
    17  =&gt;  1,
    18  =&gt;  1,
    19  =&gt;  1,
    20  =&gt;  1,
    21  =&gt;  1.5,
    22  =&gt;  1.5,
    23  =&gt;  1.5,
    24  =&gt;  1.5,
    25  =&gt;  1.5,
    26  =&gt;  1.5,
    27  =&gt;  1.5,
    28  =&gt;  1.5,
    29  =&gt;  1.5,
    30  =&gt;  1.5,
    31  =&gt;  1.5,
    32  =&gt;  1.5,
    33  =&gt;  1.5,
    34  =&gt;  1.5,
    35  =&gt;  1.5,
    36  =&gt;  1.5,
    37  =&gt;  1.5,
    38  =&gt;  1.5,
);


edit: The max and min values of the discounts never change. Here is how I'm calculating the discount and arriving at the final price:

if($v[0]['leg_discount'] == '1' &amp;&amp; $v[0]['qty'] &gt;= 6){
    $discount = $qty * $leg_directory_discount[$qty];
    $price = $price - $discount;
}
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;
}