title: Order one array item without breaking its key order
body: <p>I already saw a lot of questions that ask about the topic but I am unable to solve my problem.</p>
  
  <p>I am fetching an array with menu id items from database and those items can be sometimes be updated. </p>
  
  <p>The array of ids I receive from db is:</p>
  
  <pre><code>array(3) {
    [0]=&gt;
    int(1)
    [1]=&gt;
    int(6)
    [2]=&gt;
    int(2)
  }
  </code></pre>
  
  <p>And I need id 2 (int) to move into the key position 0 ($sortindex) without breaking the array items order. So the desire result would be:</p>
  
  <pre><code>array(3) {
    [0]=&gt;
    int(2)
    [1]=&gt;
    int(1)
    [2]=&gt;
    int(6)
  }
  </code></pre>
  
  <p>For that I am trying to use usort but without success:</p>
  
  <pre><code>usort($data, function($a, $b) use ($sortindex){
  
      if ($a == $b) {
          return 0;
      }
  
      if ($a == $sortindex) {
          return 1;
      }
  
  });
  </code></pre>
  
  <p>This could happen to any other item id. For example I could order id 1 from 0 key position to 2 and the result would be:</p>
  
  <pre><code>array(3) {
    [0]=&gt;
    int(6)
    [1]=&gt;
    int(2)
    [2]=&gt;
    int(1)
  }
  </code></pre>