How to obtain or print the data of an array within another php array

0

I have a cosulta that returns me the following arrangement

array(1) {
  [0]=>
  array(2) {
    [0]=>
    array(1) {
      ["total"]=>
      string(19) "2018-10-23 10:17:00"
    }
    ["r"]=>
    array(1) {
      ["id"]=>
      string(3) "239"
    }
  }
}

I can only get one so $arreglo = [0]['r']['id'] , but with the other I can not do the same since it is not within r

    
asked by R3d3r 82 23.10.2018 в 23:45
source

1 answer

0

The same as what you did but taking the other index. All php fixes have an index, when one is not specified, php assigns a default one, usually numbers starting from 0. So you can access it like this

$elOtroDato = [0][0]['total'];
    
answered by 23.10.2018 / 23:49
source