<?php
$array = [
['id' => 18460, 'field_id' => 14, 'parent_id' => 165, 'custom_tab_field_id' => 17775, 'status' => 0, 'field_type' => 0],
['id' => 18460, 'field_id' => 2, 'parent_id' => 165, 'custom_tab_field_id' => 17776, 'status' => 0, 'field_type' => 2],
['id' => 18460, 'field_id' => 14, 'parent_id' => 165, 'custom_tab_field_id' => 17777, 'status' => 2, 'field_type' => 2],
];
$findKey = 'custom_tab_field_id';
$getKey = 'status';
$findVal = 17777;
$arrKeyValue = array_column($array,$getKey,$findKey);
$status = $arrKeyValue[$findVal];
var_dump($status);
- Output for 7.4.0 - 7.4.33, 8.0.1 - 8.0.30, 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.25, 8.4.1 - 8.4.12
- int(2)
preferences:
113.7 ms | 406 KiB | 5 Q