php  键值数组查询 ,需要先将其转换为纯数组,然后才能用in_array 进行搜索。

$arr_combos = [
  ['id' => '1001', 'value' => 'zs' ],
  ['id' => '1002', 'value' => 'ls' ]
]

echo in_array('1001', array_column($arr_combos, 'id')) ; // print true ;

相关文章:

  • 2022-12-23
  • 2021-11-15
  • 2022-02-20
  • 2022-12-23
  • 2021-06-12
  • 2021-06-23
  • 2021-08-25
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-02-27
  • 2021-10-01
  • 2021-11-13
  • 2021-06-13
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案