<?php
$array = Array (
0 => Array ( 'id' => 1, 'column2' => 'value2', 'column3' => 'value3', 'column4' => 'value4', 'column5' => 'value5' ),
1 => Array ( 'id' => 1, 'column2' => 'value2', 'column3' => 'value3', 'column4' => 'value4', 'column5' => 'value5' ),
2 => Array ( 'id' => 2, 'column2' => 'value2', 'column3' => 'value3', 'column4' => 'value4', 'column5' => 'value5' ),
);
$keys = array_keys(array_column($array, 'column2'), value2);
//$new_array = array_map(function($k) use ($array){return $array[$k];}, $keys);
print_r($keys);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename: /in/OS2hR
function name: (null)
number of ops: 15
compiled vars: !0 = $array, !1 = $keys
line #* E I O op fetch ext return operands
-------------------------------------------------------------------------------------
3 0 E > ASSIGN !0, <array>
10 1 INIT_FCALL 'array_keys'
2 INIT_FCALL 'array_column'
3 SEND_VAR !0
4 SEND_VAL 'column2'
5 DO_ICALL $3
6 SEND_VAR $3
7 FETCH_CONSTANT ~4 'value2'
8 SEND_VAL ~4
9 DO_ICALL $5
10 ASSIGN !1, $5
12 11 INIT_FCALL 'print_r'
12 SEND_VAR !1
13 DO_ICALL
14 > RETURN 1
Generated using Vulcan Logic Dumper, using php 8.0.0
preferences:
147.21 ms | 1394 KiB | 19 Q