title: Get values from nested array
body: <p>I need help getting the values from this array.</p>
  
  <p>I have this from a mysql db</p>
  
  <pre><code>Array ( [Descuento] =&gt; D.L. 25897 AFP [0] =&gt; D.L. 25897 AFP [Monto] =&gt; 69.2000 [1] =&gt; 69.2000 [Nombre] =&gt; MARLENE JESUS [2] =&gt; MARLENE JESUS )
  
  Array ( [Descuento] =&gt; Tardanzas [0] =&gt; Tardanzas [Monto] =&gt; 0.0500 [1] =&gt; 0.0500 [Nombre] =&gt; MARLENE JESUS [2] =&gt; MARLENE JESUS )
  
  Array ( [Descuento] =&gt; Inasistencias [0] =&gt; Inasistencias [Monto] =&gt; 24.4900 [1] =&gt; 24.4900 [Nombre] =&gt; MARLENE JESUS [2] =&gt; MARLENE JESUS )
  
  Array ( [Descuento] =&gt; Cafae-SE [0] =&gt; Cafae-SE [Monto] =&gt; 16.3000 [1] =&gt; 16.3000 [Nombre] =&gt; MARLENE JESUS [2] =&gt; MARLENE JESUS ) 
  </code></pre>
  
  <p>I get this from a Mysql query</p>
  
  <pre><code>SELECT Dscto01 AS Descuento, Mto01 AS Monto, NOMBRES AS Nombre
  FROM  data WHERE Dscto01 IS NOT NULL AND DNI = :dni
  UNION ALL
                                                                      SELECT Dscto02, Mto02, NOMBRES
                                                                      FROM  data
                                                                      WHERE Dscto02 IS NOT NULL AND DNI = :dni
                                                                      UNION ALL
                                                                      SELECT Dscto03, Mto03, NOMBRES
                                                                      FROM  data
                                                                      WHERE Dscto03 IS NOT NULL AND DNI = :dni
                                                                      UNION ALL
                                                                      SELECT Dscto04, Mto04, NOMBRES
                                                                      FROM  data
                                                                      WHERE Dscto04 IS NOT NULL AND DNI = :dni
                                                                      UNION ALL
                                                                      SELECT Dscto05, Mto05, NOMBRES
                                                                      FROM  data
                                                                      WHERE Dscto05 IS NOT NULL AND DNI = :dni
                                                                      UNION ALL
                                                                      SELECT Dscto06, Mto06, NOMBRES
                                                                      FROM  data
                                                                      WHERE Dscto06 IS NOT NULL AND DNI = :dni
                                                                      UNION ALL
                                                                      SELECT Dscto07, Mto07, NOMBRES
                                                                      FROM  data
                                                                      WHERE Dscto07 IS NOT NULL AND DNI = :dni
                                                                      UNION ALL
                                                                      SELECT Dscto08, Mto08, NOMBRES
                                                                      FROM  data
                                                                      WHERE Dscto08 IS NOT NULL AND DNI = :dni
                                                                      UNION ALL
                                                                      SELECT Dscto09, Mto09, NOMBRES
                                                                      FROM  data
                                                                      WHERE Dscto09 IS NOT NULL AND DNI = :dni
                                                                      UNION ALL
                                                                      SELECT Dscto10, Mto10, NOMBRES
                                                                      FROM  data
                                                                      WHERE Dscto10 IS NOT NULL AND DNI = :dni
                                                                      UNION ALL
                                                                      SELECT Dscto11, Mto11, NOMBRES
                                                                      FROM  data
                                                                      WHERE Dscto11 IS NOT NULL AND DNI = :dni
                                                                      UNION ALL
                                                                      SELECT Dscto12, Mto12, NOMBRES
                                                                      FROM  data
                                                                      WHERE Dscto12 IS NOT NULL AND DNI = :dni
                                                                      UNION ALL
                                                                      SELECT Dscto13, Mto13, NOMBRES
                                                                      FROM  data
                                                                      WHERE Dscto13 IS NOT NULL AND DNI = :dni
                                                                      UNION ALL
                                                                      SELECT Dscto14, Mto14, NOMBRES
                                                                      FROM  data
                                                                      WHERE Dscto14 IS NOT NULL AND DNI = :dni
                                                                      UNION ALL
                                                                      SELECT Dscto15, Mto15, NOMBRES
                                                                      FROM  data
                                                                      WHERE Dscto15 IS NOT NULL AND DNI = :dni
                                                                      UNION ALL
                                                                      SELECT Dscto16, Mto16, NOMBRES
                                                                      FROM  data
                                                                      WHERE Dscto16 IS NOT NULL AND DNI = :dni
                                                                      UNION ALL
                                                                      SELECT Dscto17, Mto17, NOMBRES
                                                                      FROM  data
                                                                      WHERE Dscto17 IS NOT NULL AND DNI = :dni
                                                                      UNION ALL
                                                                      SELECT Dscto18, Mto18, NOMBRES
                                                                      FROM  data
                                                                      WHERE Dscto18 IS NOT NULL AND DNI = :dni
                                                                      UNION ALL
                                                                      SELECT Dscto19, Mto19, NOMBRES
                                                                      FROM  data
                                                                      WHERE Dscto19 IS NOT NULL AND DNI = :dni
                                                                      UNION ALL
                                                                      SELECT Dscto20, Mto20, NOMBRES
                                                                      FROM  data
                                                                      WHERE Dscto20 IS NOT NULL AND DNI = :dni LIMIT :start,:end'
  </code></pre>
  
  <p>And then </p>
  
  <pre><code>foreach($result as $row) {
                      print_r ($row);}
  </code></pre>
  
  <p>In the first array the [Descuento] result should be D.L. 25897 AFP and the [Monto] 69.2000
  I need to put the [Descuento] in a variable and the [Monto] also. Can you please help me. I cant access that info.</p>
  
  <p>Thanks in advance!</p>