PHP reference specific key and value within multid

2020-02-16 03:03发布

问题:

sorry a basic question and I have resorted to asking as I can't find (or I've just got so frustrated with it) the solution.

I wish to reference a specific key and value within a multidimensional array. My sample array is as below.

So for key 1 and wish to reference the value contained within unique_inter (3)

Any anyone advise the function or method to do this?

Thanks

Array
(
    [1] => Array
        (
            [unique_inter] => 3
            [user_id] => 1
        )

    [4] => Array
        (
            [unique_inter] => 1
            [user_id] => 4
        )

)

回答1:

$your_array[1]['unique_inter']