3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $arr = array( "0" => Array ( "0" => 1134, "1" => 2014, "2" => "type1" ), "1" => Array ( "0" => 1133, "1" => 2014, "2" => "type1" ), "2" => Array ( "0" => 1132, "1" => 2014, "2" => "type2" ), "3" => Array ( "0" => 1131, "1" => 2014, "2" => "type2" ), "4" => Array ( "0" => 1130, "1" => 2013, "2" => "type1" )); $type1 = array_column($arr, 2, 1); Var_dump($type1);
based on WApdq
Output for 5.6.0 - 5.6.30, hhvm-3.18.5 - 3.22.0, 7.0.0 - 7.3.0beta1
array(2) { [2014]=> string(5) "type2" [2013]=> string(5) "type1" }