title: php: how to get main key from multi-dimension array
body: <p>Ii just realised that I don't know how to get the main key from a multi-dimension array.</p>
  
  <p>Here is my dynamic generated array:</p>
  
  <pre><code>$tempArray = Array ( 
  [2013-03-13 15:56:57] =&gt; Array ( [PROD] =&gt; product2 [RFID] =&gt; 0030313 ) 
  [2013-03-08 14:11:51] =&gt; Array ( [PROD] =&gt; product1 [RFID] =&gt; 0020313 ) 
  )
  </code></pre>
  
  <p>Now how to get the main key?? or the value of the <code>[2013-03-13 15:56:57]</code>?<br/>
  example: <code>$FirstDate = [2013-03-13 15:56:57]</code>, so how to get and assign it?<br/>
  Tested but error :-<br/></p>
  
  <pre><code>$tempArray[0] : Undefined offset: 0...&lt;br/&gt;
  $tempArray[0][0] : Undefined offset: 0...&lt;br/&gt;
  </code></pre>