如何检查PHP数组中的任何键中是否存在值

如何检查PHP数组中的任何键中是否存在值

问题描述:

Hello All,

我有一个大约20个关键项的数组,每个键有13个值。如果存在,我需要在所有键中搜索特定值,如果存在,我需要该值的键索引。

例如我有

数组



[0] =>数组



[0] => abc

[1] => def

[2] => ghi

[3] => jkl

[4] => mno

[5] => dfdsg

[6] => PIC

[7] => pqr

[8] => 1543

[9] => stu

[10] => wx

[11] => yz

[12] =>我们

[13] => fewfw





从这里我需要搜索def,我需要关键索引def 。

请帮忙。



我尝试过的事情:



$ ids = array_column($ array,'1');

if(isset($ ids [$ array [$ ind] [1]]))

{

}

Hello All,
I have an array of around 20 key items with 13 value in each key. I need to search specific value in all the keys if exists and if it exists I need the key index of that value.
For e.g. I have
Array
(
[0] => Array
(
[0] => abc
[1] => def
[2] => ghi
[3] => jkl
[4] => mno
[5] => dfdsg
[6] => PIC
[7] => pqr
[8] => 1543
[9] => stu
[10] => wx
[11] => yz
[12] => we
[13] => fewfw
)
)
From this I need to search for "def" and I need the key index of "def".
Please help .

What I have tried:

$ids = array_column($array, '1');
if(isset($ids[$array[$ind][1]]))
{
}

ids = array_column(
ids = array_column(


array,'1');

if(isset(
array, '1');
if(isset(


ids