title: PHP - compare multiple values and form them in specific order
body: <p>So, I have an array:</p>
  
  <pre><code>$n=array('175','102','99','10','250','302');
  </code></pre>
  
  <p>I want to compare each value with each another and to echo four (or five) statuses for them (1 - lowest, 2 - low, 3 - mid, 4 - highest). How do I do that with PHP?</p>
  
  <p>I know a way where I can echo only three statuses (low, mid, high):</p>
  
  <pre><code>$status=array();
  $min_n=min($n);
  $max_n=max($n);
  
  for($i=0;$i&lt;count($n);$i++){
      if($n[$i]==$min_n){
          $status[$i]='1';
      }elseif($n[$i]==$max_n){
          $status[$i]='3';
      }else{
          $status[$i]='2';
      }
  
      echo $n[$i].' status - '.$status[$i].'&lt;br /&gt;';
  }
  </code></pre>
  
  <p>echo will be:</p>
  
  <pre><code>175 status - 2
  102 status - 2
  99 status - 2
  10 status - 1
  250 status - 2
  302 status - 3
  </code></pre>
  
  <p>But if I need four (or five) statuses?</p>