0

How to access the value of an inside array in PHP?

Array
(
    [exists] => 1
    [detail] => Array
        (
            [memberDetailID] => 73
            [memberID] => 111
            [memberTitle] => Mr
        )

)

1 Answers1

0

You need to add other column:

Array
(
    [exists] => 1
    [detail] => Array
        (
            [memberDetailID] => 73
            [memberID] => 111
            [memberTitle] => Mr
        )

)

$yourArray['detail']['memberID'];

Accessing array elements with square bracket syntax

Array elements can be accessed using the array[key] syntax.

Example #6 Accessing array elements

<?php
$array = array(
    "foo" => "bar",
    42    => 24,
    "multi" => array(
         "dimensional" => array(
             "array" => "foo"
         )
    )
);

var_dump($array["foo"]);
var_dump($array[42]);
var_dump($array["multi"]["dimensional"]["array"]);
?>

Next time search better before ask so basic question, you need to put more effort.

capcj
  • 1,535
  • 1
  • 16
  • 23