php assoc array find that item just before that value
<p>I have an associative array, say:</p>

<pre><code>$a=array('x'=&gt;3,'y'=&gt;6,'z'=&gt;12);
</code></pre>

<p>and a value, say <code>$c=9</code></p>

<p><strong>From this, how can I get the last element before the value $c in $a?</strong></p>

<p>EG: if $c=4, then return 'x', if its 99 return 'z', if its 7 return 'y' if its 11 return 'y'...that sort of thing...</p>
