<?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.28, 8.2.0 - 8.2.19, 8.3.0 - 8.3.7
- int(2)
preferences:
84.43 ms | 402 KiB | 123 Q