-1

Can anybody explain me how can i get the value of 'ubicacion' in those arrays, and then, store that value in a php variable.

Array
(
[0] => Array
    (
        [PC] => Array
            (
                [ubicacion] => 02021002
            )

      )

 )
 Array
(
[0] => Array
    (
        [PC] => Array
            (
                [ubicacion] => 034267211
            )

      )

 )
  • 4
    You don't need a loop. `echo $array[0]['PC']['ubicacion']` will give you the required value. – Amal Murali Dec 12 '15 at 04:19
  • Thank you for your answer, i'm just begining to learn php, one last question. What if i want to get the values of ubicacion simultaneously. with those arrays. Array ( [0] => Array ( [PC] => Array ( [ubicacion] => 02021002 ) ) ) Array ( [0] => Array ( [PC] => Array ( [ubicacion] => 01001002 ) ) ) – Ricardo Gonzalez Dec 12 '15 at 04:54

1 Answers1

1

This will give you the value of it..

$value = $array[0]['PC']['ubicacion'];
Waqas Shahid
  • 1,051
  • 1
  • 7
  • 22