PHP在多维数组中引用特定键和值

时间:2022-03-24 21:27:14

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)

所以对于键1并希望引用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 个解决方案

#1


8  

$your_array[1]['unique_inter']

#1


8  

$your_array[1]['unique_inter']