title: Accessing 2d Array php
body: <p>Hello all i keep having error everytime i access the array "Undefined index: total";
  I did manage to get the data out of the array but i wish the notice of undefined index will go away.
  Below is my implementation.
  Define the array :</p>
  
  <pre><code>$districttemp = array(
      'areaname'=&gt;array(),
      'total'=&gt;array()
  );
  </code></pre>
  
  <p>Accessing the array:</p>
  
  <pre><code>foreach($districttemp as $key =&gt; $obj){
           echo $key;
           echo "&amp;nbsp";
           echo $obj['areaname'];
           echo "&amp;nbsp";
           echo $obj['total'];
           echo "&lt;br&gt;";
  } 
  </code></pre>
  
  <p>It is when i accessing the array that occur the error.</p>