<?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'), 2);
//$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/5uUFf
function name: (null)
number of ops: 14
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 SEND_VAL 2
8 DO_ICALL $4
9 ASSIGN !1, $4
12 10 INIT_FCALL 'print_r'
11 SEND_VAR !1
12 DO_ICALL
13 > RETURN 1
Generated using Vulcan Logic Dumper, using php 8.0.0
preferences:
160.34 ms | 1394 KiB | 19 Q