title: How to initialize multidimensional associative array with empty values
body: <p>I want to create and initialize a multidimensional array with known possible keys for the second dimension but no values.</p>
  
  <p>This array will store <code>event_ids</code> (populated dynamically) and for each <code>event_id</code> an array having exactly four different counts (also filled dynamically).</p>
  
  <p><strong>Structure I want to create</strong></p>
  
  <pre><code>Array
  (
      [0] =&gt; Array  =================&gt; This index will be the event_id 
          (
              [invitation_not_sent_count] =&gt; 
              [no_response_yet_count] =&gt; 
              [will_not_attend_count] =&gt; 
              [will_attend_count] =&gt; 
          )
  )
  </code></pre>
  
  <p><strong>What I did so far?</strong></p>
  
  <pre><code>$DataArray = array();
  $DataArray[] = array('invitation_not_sent_count' =&gt; '',
                                          'no_response_yet_count' =&gt; '',
                                          'will_not_attend_count' =&gt; '',
                                          'will_attend_count' =&gt; '');
  </code></pre>
  
  <p>And inside the loop I am populating data dynamically like:</p>
  
  <pre><code>$DataArray[$result-&gt;getId()]['no_response_yet_count'] = $NRCount;
  </code></pre>
  
  <p>What I get is:</p>
  
  <pre><code>Array
  (
  [0] =&gt; Array
      (
          [invitation_not_sent_count] =&gt; 
          [no_response_yet_count] =&gt; 
          [will_not_attend_count] =&gt; 
          [will_attend_count] =&gt; 
      )
  
  [18569] =&gt; Array
      (
          [no_response_yet_count] =&gt; 2
      )
  
  [18571] =&gt; Array
      (
          [no_response_yet_count] =&gt; 1
      )
  </code></pre>
  
  <p>)</p>
  
  <p>What I want is that if a value is not available in the iteration, its entry should be empty as defined at initialization time. So if all other counts are empty in the data except <code>no_response_yet_count</code>, the array should be: </p>
  
  <p><strong>Expected Output</strong></p>
  
  <pre><code>Array
  (
  [18569] =&gt; Array
      (
          [invitation_not_sent_count] =&gt; 
          [no_response_yet_count] =&gt; 2
          [will_not_attend_count] =&gt; 
          [will_attend_count] =&gt;
      )
  
  [18571] =&gt; Array
      (
          [invitation_not_sent_count] =&gt; 
          [no_response_yet_count] =&gt; 1
          [will_not_attend_count] =&gt; 
          [will_attend_count] =&gt;
      )
  </code></pre>
  
  <p>)</p>