3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $arr =[ [ "websites" => "base", "simples_skus" => "", "sku" => "8681455000016", "code" => "10001", ], [ "websites" => "base", "simples_skus" => "", "sku" => "8681455000023", "code" => "10001", ], [ "websites" => "base", "simples_skus" => "", "sku" => "8681455000214", "code" => "20003", ], [ "websites" => "base", "simples_skus" => "", "sku" => "8681455000221", "code" => "20003", ], [ "websites" => "base", "simples_skus" => "", "sku" => "8681455000245", "code" => "23443", ] ]; $result = array_merge_recursive(array_values($arr),array_values($arr)); var_dump($result);
based on 7khPk
Output for 5.6.0 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.2.0
array(10) { [0]=> array(4) { ["websites"]=> string(4) "base" ["simples_skus"]=> string(0) "" ["sku"]=> string(13) "8681455000016" ["code"]=> string(5) "10001" } [1]=> array(4) { ["websites"]=> string(4) "base" ["simples_skus"]=> string(0) "" ["sku"]=> string(13) "8681455000023" ["code"]=> string(5) "10001" } [2]=> array(4) { ["websites"]=> string(4) "base" ["simples_skus"]=> string(0) "" ["sku"]=> string(13) "8681455000214" ["code"]=> string(5) "20003" } [3]=> array(4) { ["websites"]=> string(4) "base" ["simples_skus"]=> string(0) "" ["sku"]=> string(13) "8681455000221" ["code"]=> string(5) "20003" } [4]=> array(4) { ["websites"]=> string(4) "base" ["simples_skus"]=> string(0) "" ["sku"]=> string(13) "8681455000245" ["code"]=> string(5) "23443" } [5]=> array(4) { ["websites"]=> string(4) "base" ["simples_skus"]=> string(0) "" ["sku"]=> string(13) "8681455000016" ["code"]=> string(5) "10001" } [6]=> array(4) { ["websites"]=> string(4) "base" ["simples_skus"]=> string(0) "" ["sku"]=> string(13) "8681455000023" ["code"]=> string(5) "10001" } [7]=> array(4) { ["websites"]=> string(4) "base" ["simples_skus"]=> string(0) "" ["sku"]=> string(13) "8681455000214" ["code"]=> string(5) "20003" } [8]=> array(4) { ["websites"]=> string(4) "base" ["simples_skus"]=> string(0) "" ["sku"]=> string(13) "8681455000221" ["code"]=> string(5) "20003" } [9]=> array(4) { ["websites"]=> string(4) "base" ["simples_skus"]=> string(0) "" ["sku"]=> string(13) "8681455000245" ["code"]=> string(5) "23443" } }