您好,我对PHP相当陌生,想知道如何在同一个数组中找到特定的token
和token_time
。例如,如何在下面的数组中找到token
值440745553780011a38b207466e2dae1a
以及token_time
值1495672355
并让它们显示?如何在PHP数组中找到特定值
阵列
array (size=1)
'token' =>
array (size=4)
0 =>
array (size=2)
'token' => string '04a1dd0991b366fdc4d7d46fcff03cb3' (length=32)
'token_time' => int 1495672339
1 =>
array (size=2)
'token' => string '80d84dc863cbbeaef0c9a448f7865352' (length=32)
'token_time' => int 1495672345
2 =>
array (size=2)
'token' => string '440745553780011a38b207466e2dae1a' (length=32)
'token_time' => int 1495672355
3 =>
array (size=2)
'token' => string '766ac765d2a34e01cd954444d5895208' (length=32)
'token_time' => int 1495672525
这种解决方案的问题是,如果数组不匹配元素的元素,搜索将失败。问题在于找到特定的令牌和token_time,大概是在数组中可能包含的不仅仅是“token”和“token_time”。 – user2914191