title: get sub array key php
body: <p>i have an array:</p>
  
  <pre><code>Array
  ( 
  [47] =&gt; Array
      (
          [name] =&gt; 3543 good
          [price] =&gt; 100.0000
          [image] =&gt; data/hp_1.jpg
          [discount] =&gt; 
          [stock_status] =&gt; 
          [weight_class] =&gt; kg
      )
  
  [28] =&gt; Array
      (
          [name] =&gt; HTC Touch HD
          [price] =&gt; 100.0000
          [image] =&gt; data/htc_touch_hd_1.jpg
          [discount] =&gt; 
          [stock_status] =&gt; 
          [weight_class] =&gt; g
      )
  
  [41] =&gt; Array
      (
          [name] =&gt; iMac
          [price] =&gt; 100.0000
          [image] =&gt; data/imac_1.jpg
          [discount] =&gt; 
          [stock_status] =&gt; 
          [weight_class] =&gt; kg
      )
  
  [40] =&gt; Array
      (
          [name] =&gt; iPhone
          [price] =&gt; 101.0000
          [image] =&gt; data/iphone_1.jpg
          [discount] =&gt; 
          [stock_status] =&gt; 
          [weight_class] =&gt; kg
      )
  )
  </code></pre>
  
  <p>i need the sub array key (47 ,28  etc) as it is my product id</p>
  
  <p>I'm running a foreach loop to get the details and assigning to a new array e.g. <code>'name' =&gt; $result['name']</code> but can't figure out how to target the product id.</p>