using array to determine score
<p>Basically I wondering the best approach to determine a score based on a range defined in an array</p>

<p>I have a set of values ranging between 300 and 900 , each value has a corresponding percentile range.</p>

<p>I want to create a function that gives you the percentile based on the value checked. The value passed into the function may not match the defined value in the array, but want to return the highest percentile for that value.</p>

<p>For example in the array will be something like </p>

<pre><code>'300'=&gt;'10', '333'=&gt;'11', '340' =&gt; '12'  .... '900'=&gt;'100'
</code></pre>

<p>IF I pass in 335, then the function should return 11. Not sure simplest approach.</p>
