title: Sorting and merge associative array (PHP)
body: <p>I have 2 associative arrays:</p>
  
  <pre><code>[0] =&gt; Array (
      [time] =&gt; 09:00:00
      [name] =&gt; To do something 1
      )
  [1] =&gt; Array (
      [time] =&gt; 09:30:00
      [name] =&gt; To do something 2
      )
  [2] =&gt; Array (
      [time] =&gt; 10:00:00
      [name] =&gt; To do something 3
      )
  </code></pre>
  
  <p>and</p>
  
  <pre><code>[0] =&gt; Array (
      [time] =&gt; 09:00:00
      )
  [1] =&gt; Array (
      [time] =&gt; 09:15:00
      )
  [2] =&gt; Array (
      [time] =&gt; 09:30:00
      )
  [3] =&gt; Array (
      [time] =&gt; 09:45:00
      )
  [4] =&gt; Array (
      [time] =&gt; 10:00:00
      )
  </code></pre>
  
  <p>Need to do another associative array:</p>
  
  <ul>
  <li>if the field [time] in second array equals field [time] in first array then add [name];</li>
  <li>if field [time] in second array not equals field [time] in first array then add empty [name].</li>
  </ul>
  
  <p>Should look like this:</p>
  
  <pre><code>[0] =&gt; Array (
      [time] =&gt; 09:00:00
      [name] =&gt; To do something 1
      )
  [1] =&gt; Array (
      [time] =&gt; 09:15:00
      [name] =&gt; 
      )
  [2] =&gt; Array (
      [time] =&gt; 09:30:00
      [name] =&gt; To do something 2
      )
  [3] =&gt; Array (
      [time] =&gt; 09:45:00
      [name] =&gt; 
      )
  [4] =&gt; Array (
      [time] =&gt; 10:00:00
      [name] =&gt; To do something 3
      )
  </code></pre>