title: PHP - Find exact value or value above from array
body: <p>I have a nested array with valid numbers => data:-</p>
  
  <pre><code>$validData = array(array(1 =&gt; 'one data'),array(5 =&gt; '5 data'),array(15 =&gt; '15 data'),array(30 =&gt; 'thirty data'));
  </code></pre>
  
  <p>Let say I have a query value, $query = 14;</p>
  
  <p>I want to first check if there's a 14, if not then go to the nearest option ABOVE.</p>
  
  <p>I've been doing nearest item with max, array_keys and ranges. But, matching or going above for some reason I can't see the best way?</p>