title: Prepend key value to array - PHP
body: <p>I have the below code in a <code>for..loop</code> is there a way I can add values to the beginning of the array?</p>
  
  <pre><code>    $data = array();
  
      $initial = strtotime('11:00:00');
      for (; $initial &lt; strtotime("23:00:59");  $initial = strtotime("+15 minutes", $initial)) {
          if ($initial &gt; strtotime("+45 minutes", time())) {
              $row['value'] = date('Hi', $initial);
              $row['label'] = date('H:i', $initial);
              $data['data'][] = $row;
          }
      }
  </code></pre>
  
  <p>I want to add the below values to the top of the array. I have tried using <code>array_unshift</code> but I don't think it supports key-value pairs.</p>
  
  <pre><code>    if(!isBetween('22:00', '09:59', date('H:i'))) {
          $row['value'] = "asap";
          $row['label'] = "ASAP";
      }
  </code></pre>
  
  <p>My array output</p>
  
  <pre><code>{
    "data": [
      {
        "value": "1145",
        "label": "11:45"
      }
    ]
  }
  </code></pre>
  
  <p>I want to get this</p>
  
  <pre><code>{
    "data": [
      {
        "value": "asap",
        "label": "ASAP"
      },{
        "value": "1145",
        "label": "11:45"
      },
    ]
  }
  </code></pre>