title: Group and order array of objects in php by string value
body: <p>I have an array of objects which looks like this, note that they are already ordered by create_time via MYSQL:</p>
  
  <pre><code>array (size=5)
    0 =&gt; 
      object(stdClass)[38]
        public 'vacancy_id' =&gt; int 5
        public 'title' =&gt; string 'test title' (length=10)
        public 'create_time' =&gt; string '2018-10-05 11:15:34' (length=19)
        public 'language_iso' =&gt; string 'NL' (length=2)
    1 =&gt; 
      object(stdClass)[42]
        public 'vacancy_id' =&gt; int 9
        public 'title' =&gt; string 'test title 5' (length=12)
        public 'create_time' =&gt; string '2018-08-05 11:15:34' (length=19)
        public 'language_iso' =&gt; string 'EN' (length=2)
    2 =&gt; 
      object(stdClass)[40]
        public 'vacancy_id' =&gt; int 7
        public 'title' =&gt; string 'test title 3' (length=12)
        public 'create_time' =&gt; string '2018-08-05 11:15:34' (length=19)
        public 'language_iso' =&gt; string 'FR' (length=2)
    3 =&gt; 
      object(stdClass)[39]
        public 'vacancy_id' =&gt; int 6
        public 'title' =&gt; string 'test title 2' (length=12)
        public 'create_time' =&gt; string '2018-06-05 11:15:34' (length=19)
        public 'language_iso' =&gt; string 'FR' (length=2)
    4 =&gt; 
      object(stdClass)[41]
        public 'vacancy_id' =&gt; int 8
        public 'title' =&gt; string 'test title 4' (length=12)
        public 'create_time' =&gt; string '2018-02-05 11:15:34' (length=19)
        public 'language_iso' =&gt; string 'NL' (length=2)
  </code></pre>
  
  <p>On my page I am implementing a sorting functionality. There's (for now) 4 sorting options:</p>
  
  <ul>
  <li>By create_time (this is the default sort as well, as done in MySQL. And I always want to keep this sort).</li>
  <li>By NL language iso</li>
  <li>By FR language iso</li>
  <li>By EN language iso</li>
  </ul>
  
  <p>In the array example as given above, let's say I want to sort by "FR language iso". This means that I want my result set to look like this:</p>
  
  <pre><code>array (size=5)
    0 =&gt; 
      object(stdClass)[40]
        public 'vacancy_id' =&gt; int 7
        public 'title' =&gt; string 'test title 3' (length=12)
        public 'create_time' =&gt; string '2018-08-05 11:15:34' (length=19)
        public 'language_iso' =&gt; string 'FR' (length=2)
    1 =&gt; 
      object(stdClass)[39]
        public 'vacancy_id' =&gt; int 6
        public 'title' =&gt; string 'test title 2' (length=12)
        public 'create_time' =&gt; string '2018-06-05 11:15:34' (length=19)
        public 'language_iso' =&gt; string 'FR' (length=2)
    2 =&gt; 
      object(stdClass)[38]
        public 'vacancy_id' =&gt; int 5
        public 'title' =&gt; string 'test title' (length=10)
        public 'create_time' =&gt; string '2018-10-05 11:15:34' (length=19)
        public 'language_iso' =&gt; string 'NL' (length=2)
    3 =&gt; 
      object(stdClass)[42]
        public 'vacancy_id' =&gt; int 9
        public 'title' =&gt; string 'test title 5' (length=12)
        public 'create_time' =&gt; string '2018-08-05 11:15:34' (length=19)
        public 'language_iso' =&gt; string 'EN' (length=2)
    4 =&gt; 
      object(stdClass)[41]
        public 'vacancy_id' =&gt; int 8
        public 'title' =&gt; string 'test title 4' (length=12)
        public 'create_time' =&gt; string '2018-02-05 11:15:34' (length=19)
        public 'language_iso' =&gt; string 'NL' (length=2)
  </code></pre>
  
  <p>So in this example, the result must contain:</p>
  
  <ul>
  <li>Results with language_iso FR on top, but still within them, sorted by create_time</li>
  <li>Results with language_iso EN and NL go under the FR results, but also within them, sorted by create_time</li>
  </ul>
  
  <p>I've been completely running blank using a custom function in php's usort function. </p>